question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to resolve timezone for certain Docker containers

See original GitHub issue

I’ve noticed this with the latest ESPHome docker container:

image

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
regebrocommented, Apr 14, 2022

I added a note about this in the readme. Thanks!

0reactions
pedrolamascommented, Apr 4, 2022

This of course all boils down to the problem that Unix does not have one official way of configuring this, but many. And that’s nothing I can do anything about.

Fully agree with this one! 😁

The way to fix that is to either fix the conflict or set up a TZ environment variable.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found