
After I provided my input, it hung there.
Docker utc time zone install#
RUN apt-get install -y tzdata When I run it, it asks for my input.

Docker utc time zone how to#
The desired time zone from this folder can be copied to /etc/localtime. How to install tzdata on a ubuntu docker image Ask Question Asked 4 years, 4 months ago Modified 1 month ago Viewed 178k times 196 I have the following line in the Dockerfile. Then I pulled the official Ubuntu 18.04 docker image, and run a vanilla container from it, installed Python3 in it, and run the test again, the result is right. The directory /usr/share/zoneinfo in Docker contains the container time zones available. In the meantime, the default timestamp seems to be correct, it’s correct local time. How do I configure the containers time zone First, you need both host and guest versions containing this feature, which means running on a 2105B servicing patch or higher. By default, Docker and Container uses UTC timezone. The result of getting Unix timestamp does not match that from Python output, actually the “UNIX timestamp” is not UTC, but it’s a seconds value for my local timezone (UTC+0800), passing it to Python’s time.ctime(), which expects UTC timestamp, will print the time 8 hours in the future. However, above works only if the image is fedora based. For example: docker run ubuntu:latest date Sat Feb 27 15:58: docker run -e TZAsia/Kolkata ubuntu:latest date Sat Feb 27 15:58:40 Asia 2021. If I run this in a docker (the image is based on Ubuntu 18.04, but with lots of other stuff added): - t is T11:39:34 The timezone of a container can be set using an environment variable in the docker container when it is created. Python time: 1655696306.6099617 Mon Jun 20 11:38:26 2022
