制作镜像时出现debconf: unable to initialize frontend: Dialog

docker在制作镜像时,抛出异常

debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:

原因是因为在使用apt-get安装依赖时并非静默安装,需要交互,所以无法正常通过。

解决方法:

vim Dockerfile
增加一行ENV DEBIAN_FRONTEND noninteractive

你可能感兴趣的:(docker)