-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker time outof sync with osx host #1260
Comments
Not a bug, it's a feature of the xhyve VM used as docker machine on osx (it's UTC by default) |
@marcelmfs The timezone isn't the actual issue here. The time inside the the vm on Docker for Mac drifts away from system time. If you normalize the timezone to UTC In @snimavat's example, you can see that it's 08:01:45 in the vm and 08:32:31 on the host. I have the same problem with my Docker for Mac. At the moment, it's 18:11:37 in the vm, but 18:37:20 on my Mac host. My Docker for Mac VM's been up for 4 days, and the drift increases the longest it's been up. My Mac:
Inside the VM:
|
Ignoring timezone, this is a partial duplicate of #17, which doesn't have a permanent solution for the time drift, but some comments include this temporary workaround to run after waking from sleep: |
@snimavat thank you for your report. Unix systems run their system clock in UTC and any appearance of timezones is entirely a userspace concern i.e. by the @kinghuang please lets keep this issue for the timezone issue which the original report is concerned about instead of hijacking it to be another dup of #17. |
Issue persists in Version 17.12.0-ce-mac47 (21805) |
from within a container:
from within my mac:
|
Same problem in Version 17.12.0-ce-mac49 (21995) |
Having the same problem - the time inside and outside of docker is off by ~7 minutes. Why is this closed with a non-answer? |
Host Mac:
6 seconds later in the Docker container:
|
See #2076 |
Without some external help, guest VMs on any platform will inevitably drift time from the host. It's a fundamental issue that VMware and Citrix deal with via the agent they highly encourage you install on the guest VM. The answer to this issue is to add a mechanism to sync time sources from host-> guest on a regular basis; either via direct hwclock assignment via crontab on the guest vm, or via a guest vm service solution like ntp/chrony. However, that explanation doesn't solve this issue for you guys with timing-sensitive docker images. I happen to have this same problem at the moment. So, in the meantime, I put together a super-gross docker image to run chrony on the VM that Docker for Mac utilizes. (https://hub.docker.com/r/eshork/docker-mac-chrony/) It's been working for me, but obviously use at your own risk. Please submit issues to the github issue tracker as you find them; I'll do my best to address them in a timely manner. My hope is that the Docker for Mac CE build has a legit fix for this issue still landing within Q3/2018. Until then, I sincerely hope my awful hack helps ya'll out a bit... |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
My osx system has IST time zone.
When i run, docker info command, it shows a wrong system time which is few hours behind the osx host. docker info shows UTC time.
I have properly configured time/timezone on my osx host... my osx dint sleep, i am actively working on my mac
Docker info shows
System Time: 2017-02-05T08:01:45.995094136Z
date command on osx shows
un Feb 5 13:32:31 IST 2017
Restarting docker does not help either
Expected behavior
Docker would have same time/time zone as osx host
Actual behavior
Docker time is different then osx host
Information
Docker for Mac: version: 1.13.0 (0c6d765c5)
macOS: version 10.11.5 (build: 15F34)
logs: /tmp/76AEDBF3-6D1A-4483-A341-F90F0E69876C/20170205-133012.tar.gz
[OK] vmnetd
[OK] dns
[OK] driver.amd64-linux
[OK] virtualization VT-X
[OK] app
[OK] moby
[OK] system
[OK] moby-syslog
[OK] db
[OK] env
[OK] virtualization kern.hv_support
[OK] slirp
[OK] osxfs
[OK] moby-console
[OK] logs
[OK] docker-cli
[OK] menubar
[OK] disk
The text was updated successfully, but these errors were encountered: