I have the following line in the Dockerfile.
RUN apt-get install -y tzdata
When I run it, it asks for my input. After I provided my input, it hung there. Does anybody know how to solve this problem?
Step 25/25 : RUN apt-get install -y tzdata
---> Running in ee47a1beff84
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
tzdata
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 189 kB of archives.
After this operation, 3104 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 tzdata all 2018i-0ubuntu0.18.04 [189 kB]
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 189 kB in 1s (219 kB/s)
Selecting previously unselected package tzdata.
(Reading database ... 25194 files and directories currently installed.)
Preparing to unpack .../tzdata_2018i-0ubuntu0.18.04_all.deb ...
Unpacking tzdata (2018i-0ubuntu0.18.04) ...
Setting up tzdata (2018i-0ubuntu0.18.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:
``
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"– Danny Staple Oct 03 '20 at 11:24RUNcommand, you can be sure that the environment variable affects only the tzdata install. – Ignatius Nov 13 '20 at 09:06sudoto runapt-get(because the user is not root), make sure to pass the-Eflag, otherwisesudowill discard all environment variables (includingDEBIAN_FRONTEND). – Resigned June 2023 Jan 23 '21 at 17:13DEBIAN_FRONTEND=noninteractive TZ=Europe/Moscow apt-get -y install tzdatastill installs with timezone as Etc/UTC same case if I set with any value it defaults to Etc/UTC – bharanitharan Apr 03 '23 at 04:57RUNcommand. In that case, the variable assignment goes in a place some might not expect if they don't commonly use that shell feature:RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install ...– GrandOpener Apr 18 '23 at 00:20