我只是在 Docker 镜像上尝试 ubuntu:19.04,希望在镜像中安装 tcl,因此我执行了以下命令:
RUN apt update && apt install tcl
然后它将给出一些交互式命令:
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 3. Antarctica 5. Arctic 7. Atlantic 9. Indian 11. SystemV 13. Etc
2. America 4. Australia 6. Asia 8. Europe 10. Pacific 12. US
我这里有两个问题:
(1) 如果在 Dockerfile 中写了以下命令,输入一个数字后,“docker build .” 似乎会因此挂起。
(2) 我希望不必手动输入选项,是否有办法在“RUN”中提供一个选项,以便自动执行?
docker/build_docker.sh
脚本出现了问题,第三行和第五行分别提示ENV
和RUN
命令未找到。 - Dmitriy OgureckiyENV
来设置该值。请使用ARG
或内联设置:DEBIAN_FRONTEND=noninteractive apt install -y ...
。参见 此问题。 - Logan