如何在Docker构建过程中避免问题?

时间:2020-04-23 13:06:00

标签: docker ubuntu dockerfile

我正在构建基于Ubuntu 18.04的Docker映像。 一切正常,但是在完成之前,我会在Powershell控制台中收到:

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        6. Asia            11. System V timezones
  2. America       7. Atlantic Ocean  12. US
  3. Antarctica    8. Europe          13. None of the above
  4. Australia     9. Indian Ocean
  5. Arctic Ocean  10. Pacific Ocean
Geographic area:
----

据我了解,它等待着我的一些回答,但我无法输入任何数字,即键盘上没有任何反应。如何避免这个问题?可能在我可以将CMD添加到dockerfile中?

2 个答案:

答案 0 :(得分:3)

我在Dockerfile中遇到了同样的问题,所以我用了 基本图片后出现“ ARG DEBIAN_FRONTEND = noninteractive ”,对我有用:

enter image description here

答案 1 :(得分:1)

这对我有用。

ENV TZ=Asia/Kolkata \
    DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install tzdata