事情就是这样。
我们有一个包在安装后询问我们是否要进行分区。在非交互模式下(在我的情况下是 docker build),我想在不问问题的情况下进行分区。
我有postinst
这个脚本块:
while [[ $answ != "yes" && $answ != "no" ]]; do
echo -n "Should i create all needed DB-partitions for current and next time periods? [yes/no] "
read answ
if [[ $answ == "yes" ]]; then
# do actions
fi
done
但是,当我在带有--yes
标志或yes | apt install ...
和DEBIAN_FRONTEND=noninteractive
envvar 的 Docker 构建中通过 APT 安装此软件包时 - 它不会在该提示上回答并进入无限循环,溢出构建日志。
我该如何解决这个问题?