【发布时间】:2021-07-30 18:34:57
【问题描述】:
鉴于此Dockerfile:
FROM ubuntu:20.04
RUN set -ex && apt-get update
RUN set -ex && \
apt-get install -y \
git
RUN set -ex && \
apt-get install -y \
cmake
ENV HOME_DIR /home/develop
WORKDIR ${HOME_DIR}
docker build 挂起配置tzdata:
$ DOCKER_BUILDKIT=0 docker build -f Docker/Dockerfile -t cmake:latest .
Sending build context to Docker daemon 161.8kB
Step 1/6 : FROM ubuntu:20.04
---> 7e0aa2d69a15
Step 2/6 : RUN set -ex && apt-get update
---> Using cache
---> 78e8a28063b0
Step 3/6 : RUN set -ex && apt-get install -y git
---> Using cache
---> d400fc509ae8
Step 4/6 : RUN set -ex && apt-get install -y cmake
---> Running in 2c58632e70a3
+ apt-get install -y cmake
Reading package lists...
Building dependency tree...
Reading state information...
...
Setting up tzdata (2021a-0ubuntu0.20.04) ...
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:
如果我颠倒git 和cmake 的顺序,它将成功构建。为什么顺序很重要?
我在 MacOS 11 (Big Sur) 上运行 Docker 20.10.5。
【问题讨论】: