How to tell docker to run any image to pick the time zone settings for the host machine.
This is necessary especially when dealing with time zone related data.
How to tell docker to run any image to pick the time zone settings for the host machine.
This is necessary especially when dealing with time zone related data.
2
Answers
Try using environment variables.
with the docker run command:
or in the docker file (you may or may not have to install tzdata, depends on the system):
You can set the TZ environment variable to the same as the host like this
This sets the TZ environment variable to the content of the /etc/timezone file of the host machine.
The above command runs the
date
command on adebian
image to show that it works.