Fix timezone on boot2docker VM #476

Open
docwhat opened this Issue Aug 7, 2014 · 4 comments

Comments

Projects
None yet
5 participants
@docwhat

docwhat commented Aug 7, 2014

When first bringing up the boot2docker (either init or up) boot2docker should copy (on the Mac, anyway) /etc/localtime to the VM.

This will fix the timezone within the boot2docker VM, which makes trouble shooting certain issues easier.

Example:

# Without /etc/localtime
date +'%I:%M %p %Z' # returns 11:33 PM UTC

# With /etc/localtime (America/New_York)
date +'%I:%M %p %Z' # returns 07:33 PM EDT
@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Aug 8, 2014

Contributor

@docwhat true - can you think of circumstances where doing this may be a problem? (I'm worried, but busy elsewhere, so hoping you could list some of the risks :))

Contributor

SvenDowideit commented Aug 8, 2014

@docwhat true - can you think of circumstances where doing this may be a problem? (I'm worried, but busy elsewhere, so hoping you could list some of the risks :))

@docwhat

This comment has been minimized.

Show comment
Hide comment
@docwhat

docwhat Aug 8, 2014

So the zoneinfo database format is pretty stable, so I don't anticipate any changes that would cause breakage. Also, boot2docker is usually pretty up-to-date so if anything it'll be a newer libc in boot2docker for an older zoneinfo format, which should always work.

Obviously, not all systems have an /etc/localtime file, such as on Windows. But if it exists, it should always be in zoneinfo format.

/etc/localtime is usually a link to /usr/share/zoneinfo/<your timezone>. That link could be broken, but then we could just fall back to whatever we do on windows (e.g. nothing or emit a warning?).

This should be pretty darn safe in the scheme of things.

docwhat commented Aug 8, 2014

So the zoneinfo database format is pretty stable, so I don't anticipate any changes that would cause breakage. Also, boot2docker is usually pretty up-to-date so if anything it'll be a newer libc in boot2docker for an older zoneinfo format, which should always work.

Obviously, not all systems have an /etc/localtime file, such as on Windows. But if it exists, it should always be in zoneinfo format.

/etc/localtime is usually a link to /usr/share/zoneinfo/<your timezone>. That link could be broken, but then we could just fall back to whatever we do on windows (e.g. nothing or emit a warning?).

This should be pretty darn safe in the scheme of things.

@sfitts

This comment has been minimized.

Show comment
Hide comment
@sfitts

sfitts Sep 24, 2014

Even on Windows it would be nice if the boot2docker vm had the same timezone as the host machine. It would obviously take more work than copying a file, but it should be doable.

sfitts commented Sep 24, 2014

Even on Windows it would be nice if the boot2docker vm had the same timezone as the host machine. It would obviously take more work than copying a file, but it should be doable.

@ARF1

This comment has been minimized.

Show comment
Hide comment
@ARF1

ARF1 Mar 19, 2017

Is there any movement on this? Is it possible to set a timezone on a Windows boot2docker vm?

ARF1 commented Mar 19, 2017

Is there any movement on this? Is it possible to set a timezone on a Windows boot2docker vm?

@wglambert wglambert added the Issue label Jul 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment