Wrong Date/Time
Expected behavior
I would expect the container date and time would match host date and time
Actual behavior
The container is a day+ behind my windows host
Information
Steps to reproduce the behavior
docker run...for ubuntu:latestdatefrom within the container- Note that the date/time is different than your windows host
@devlife thanks for the report. We use the in kernel Hyper-V time synchronisation and it should work, but may only gradually adjust time. A couple of questions:
- did this happen after your computer was set to sleep?
- did you check the time soon after waking up after sleep?
- did the gap get less over time?
This is happening to me as well, since last update
Same problem happening to me. The clock drift corresponded exactly to the time my laptop was in sleep mode. I didn't realize it immediately, but I started to see wrong behaviors in my Docker applications (ELK stack reporting logs with a time difference) just after resuming.
@rneugeba My computer was not set to sleep. I'll set my computer to sleep and check the time and see if the gap has lessened.
Disabling and then enabling again the MobyLinuxVM > Settings > Integration Services > Time synchronization service from Hyper-V Manager resyncs the clock of containers immediately.
Unfortunately I have issues with this as well. I'm using docker for windows mainly as some build/cross-compilation tool, by running a build scripts inside linux containers. This problems e.g. leads to automake failing:
checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Always happens if the PC is going to sleep (e.g. during lunch time). Does not recover until I manually restart docker, so I think it's not really syncing during runtime but only at startup. The workaround from @cvillerm helps to recover without a docker restart.
My symptom was that on every change vim would say "WARNING File has changed since last read!". Took me ages to figure out it was a time problem.
This was not happening 2 or 3 updates ago, even with regular laptop sleep/hibernation.
also ran into that problem while running terraform within a container to create an infrastructure on azure. creating a storage account failed with an authorization problem. cvillerms Tipp helped
For me, resuming from hibernate leaves the docker clock at the same time it was hibernated at. Restarting docker fixes the timestamp, but also means restarting containers...
same issue here, exactly as reported by @cfstras . Annoying thing for me is one of the containers is running keycloak and after the laptop sleeps, it issues OIDC certificates with an outdated timstamp so all my authentication chain is broken.
I would rather have docker stop all my containers after a sleep, at least I would know I have to restart everything.
Add me to the list. Using make inside Moby with time drift is impossible, so much so that I've resorted to building my containers on a remote box instead.
@rneugeba
- did this happen after your computer was set to sleep? Yes
- did you check the time soon after waking up after sleep? Yes, correction is either not happening or not happening quickly enough. -- Needs to be immediate
- did the gap get less over time? Not sure, will look into this aspect
Using Docker GUI to Restart Docker appears fix it immediately every time. Though there has got to be a more elegant solution.
Any update/priority on this issue?
Hi everyone, a fix should ship in the next Beta version (Beta31), scheduled next week.
@devlife @cvillerm @Matthias247 @cfstras @provegard @zifik @rcarmo Beta 31 was just released. It's expected to fix this issue. Please give it a try!
Docker version 1.13.0-rc2-beta31 (9132) de6f6c2
- Working with docker, all good
- Hibernate PC in the evening
- Wake up
[inside container]
# date
Wed Nov 30 21:34:24 UTC 2016
## go to hyper-v manager, disable and enable Time Sync integration
# date
Thu Dec 1 09:56:05 UTC 2016
So the issue is still there. Do I maybe have to recreate my docker machine to get the fix in? Because I'd rather not go through the process of backing up development containers.
@cfstras The Disable/Enable should have be done automatically. Can you share your logs?
Sure.
before hibernate: (log.1.txt) http://pastebin.com/egk8bhzq
after hibernate: (log.txt) http://pastebin.com/ZUw2efY9
@dgageot Thanks for working on it. Just tested with beta31 but still experience the same problem after PC went to sleep after the amount of time that was set in the windows power options (power plan) settings.
Same here:
rlpowell@680e70564cca> date Thu Dec 1 01:22:37 PST 2016 rlpowell@680e70564cca> date Thu Dec 1 08:48:11 PST 2016
I'll note that the list of integration services looks different; "Data Exchange" and "Backup" are now unchecked. Maybe your code is toggling the wrong thing depending on versions of hyper-v, or something like that?