33

I'm just trying ubuntu:19.04 on docker image, I wish to install tcl in the image so I have:

RUN apt update && apt install tcl

Then it will give some interactive commands:

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   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. SystemV  13. Etc
2. America  4. Australia   6. Asia    8. Europe    10. Pacific  12. US

I've 2 problems here:

(1) If I write this command for "RUN" in Docker file, after inputing a number here, "docker build ." seems to be hang by it.

(2) I wish I don't have to manually input a choice, do I have any way to feed a choice in "RUN" so that its automated?

funnydman
  • 9,083
  • 4
  • 40
  • 55
Troskyvs
  • 7,537
  • 7
  • 47
  • 115

2 Answers2

56

Did you try to disable it?

FROM ubuntu:19.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt update && apt install -y tcl
BMW
  • 42,880
  • 12
  • 99
  • 116
  • what does it mean, I have got `docker/build_docker.sh: line 3: ENV: command not found docker/build_docker.sh: line 5: RUN: command not found` ? – Dmitriy Ogureckiy Jan 24 '23 at 15:55
  • 2
    One _should not_ use `ENV` to set this value. Do it with `ARG` or set it inline, `DEBIAN_FRONTEND=noninteractive apt install -y ...`. See [this issue](https://github.com/moby/moby/issues/4032) – Logan Apr 28 '23 at 02:15
22

This worked for me.

ENV TZ=Asia/Kolkata \
    DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install tzdata
devarajbh
  • 519
  • 4
  • 9
  • Can you explain how did you arrived here? How does this work, expecially TZ & tzdata – Krunal Apr 19 '23 at 10:23
  • 1
    Do not use `ENV` to set `DEBIAN_FRONTEND`. See [this issue](https://github.com/moby/moby/issues/4032). – Logan Apr 28 '23 at 02:16