<分区> 分区>
Python 提供 docker 镜像 ( https://hub.docker.com//python/ ),它们有多种风格(基于来自以下不同的镜像:https://hub.docker.com/ /buildpack-deps/)。不幸的是,没有一个以 ubuntu 18.04 (bionic) 作为基础。我想构建它。
我最初认为我应该从一个“真正的”ubuntu 18.04 docker 镜像 ( https://hub.docker.com/r/library/ubuntu/ ) 开始并安装相关的 ubuntu 包,但是生成的 docker 镜像似乎很快变得非常大,当然不会拉在当前的 Python 版本 (3.7.0) 中。
接下来,我尝试简单地构建 docker hub ( https://github.com/docker-library/python/blob/8601079d1f70b03c01408377716a3243ce75cec9/3.7/stretch/Dockerfile ) 上提供的确切 Dockerfile,但将 FROM buildpack-deps:stretch 替换为 FROM buildpack-deps:bionic。不幸的是,该构建似乎需要对我的区域进行某种交互式选择,我不知道如何解决这个问题(下面的输出)。
关于如何预配置此构建使其不询问我的区域/如何禁用该提示的任何建议?
我看到了使用 expect 的建议,但不知道是否可以轻松地将其集成到 docker build 中。
Docker 构建输出
[...]
Setting up tzdata (2018d-1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
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 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
PS:使用原始FROM buildpack-deps:stretch 构建docker 镜像似乎工作正常,因此这种交互式选择与仿生基础有关。
