Failing to resolve timezone for certain Docker containers
See original GitHub issueI’ve noticed this with the latest ESPHome docker container:
As you can see on the above image, the host “/etc/localtime” has “GMT” timezone, and the same is shown inside the docker container, however there is an (incorrect) symlink to UTC!
I know I could use the TZ
variable to fix this, however I’ve been mapping the “/etc/localtime” for a long time now and never had any issues until today!
I’ve opened a similar issue against ESPHome here: https://github.com/esphome/issues/issues/2718
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Docker Container time & timezone (will not reflect changes)
I've created some containers from the basic ubuntu:trusty image, and when I run it and request 'date', I get UTC time. For awhile...
Read more >Guide: fix all time and timezone problems in Docker
Use host machine configuration This is the simplest solution for setting the time of your containers: using the time and time zone of...
Read more >How to fix timezone in Container Generated by Docker Build
The timezone inside the container (check log result) find the log time is WRONG (UTC+0) in Host B (no matter it is triggered...
Read more >Solve the inconsistent time zone problem in the container
Solution 1: create a time zone file in Dockerfile (recommended) · Run the following command to create the Dockerfile. · Press i to...
Read more >Modifying a Container Time-Zone
The default time-zone for any Docker container is UTC. In the case where you want your Docker container's time-zone to be in sync...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added a note about this in the readme. Thanks!
Fully agree with this one! 😁
This is what I’ve done since I started having this issue, and stopped mapping the
/etc/localtime
.At the time, I decided on raising this issue as my docker containers that were working fine, were now not even starting, so to me there was some breaking change on the tzlocal behavior that could have not been considered!
My personal problem was solved with the
TZ
variable, so feel free to close this if there is no further action/documentation update required.