Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid question during the Docker build?

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 ?

like image 396
ZedZip Avatar asked Dec 23 '22 18:12

ZedZip


2 Answers

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
like image 187
Parth Shah Avatar answered Dec 25 '22 07:12

Parth Shah


This worked for me.

ENV TZ=Asia/Kolkata \
    DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install tzdata
like image 35
devarajbh Avatar answered Dec 25 '22 07:12

devarajbh