27

I am building an Ubuntu 18.04 based Docker image. It is building ok but before finish I receive in the Powershell console:

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:
----

As I understand it waits some answer from me but I cannot enter any numbers, i.e. no reactions on keyboard. How to avoid this question? May be in I can add a CMD into the dockerfile ?

5
  • 2
    What does the Dockerfile look like? Have you tried using a different shell?
    – Paolo
    Apr 23, 2020 at 13:07
  • I have copy/pasted the dockerfile
    – ZedZip
    Apr 23, 2020 at 13:15
  • 6
    Try adding DEBIAN_FRONTEND=noninteractive before the apt-get statements
    – Paolo
    Apr 23, 2020 at 13:22
  • Ok, will try and let you know...
    – ZedZip
    Apr 23, 2020 at 13:49
  • Let me know and I will share at as an answer if it solved the problem
    – Paolo
    Apr 23, 2020 at 14:46

2 Answers 2

37

I had the same issue in Dockerfile, then I used ARG DEBIAN_FRONTEND=noninteractive after base image and it works for me:

Example Dockerfile:

FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
0
16

This worked for me.

ENV TZ=Asia/Kolkata \
    DEBIAN_FRONTEND=noninteractive

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

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.