我设置了以下环境,以便在apt-get安装期间不询问任何问题/对话框:
ENV DEBIAN_FRONTEND noninteractive # export DEBIAN_FRONTEND="noninteractive"
等效于:
export DEBIAN_FRONTEND="noninteractive"
但是,当从Dockerfile构建映像时,在一个特定的Debian / Ubuntu软件包安装结束时(使用apt-get install),软件包配置debconf说:
debconf: unable to initialize frontend: Noninteractive # export DEBIAN_FRONTEND="noninteractive"
debconf: (Bareword "Debconf::FrontEnd::Noninteractive" not allowed while "strict subs" in use at (eval 35) line 3, <> line 1.)
debconf: falling back to frontend: Noninteractive
Subroutine BEGIN redefined at (eval 36) line 2, <> line 1.
哇...我发现了我的错误。无法在Dockerfile的ENV行中添加注释。我要回答自己,因为我相信这会咬住其他人。