Time in MobyLinux or started containers is (and stays) in sync with host-time of the Windows-System.
Actual behavior
After fresh restart the time is in sync, after Windows-suspend or other actions without restart of Docker4Win the time is not in sync anymore.
docker run -it --rm alpine sh
/ # date
Thu May 26 03:14:12 UTC 2016
Restart docker (nothing else!)
docker run -it --rm alpine sh
/ # date
Thu May 26 09:49:29 UTC 2016
I have the same problem again. After suspended my laptop for > 1 hour, the result is:
docker run -it --rm alpine sh
/ # date
Thu May 26 13:08:54 UTC 2016
The current date/time is Thu May 26 14:58:54 UTC 2016.
I don’t think so. Also after approx. an hour the time is not resynced. What do you mean with some time?
The time-sync in hyper-v is enabled, but it seems not to work.
That is right, the Time synchronization is activated (all checkboxes have the same state on my system like in your screenshot).
I have made one more test. I have disabled and reenabled time synchronization (toggle the corresponding checkbox in hyper-v manager) without restarting docker. Now the time in a fresh startet alpine container is correct again (was strong shifted before in a fresh started alpine container because of laptop in suspend mode over night).
So I have to retrigger time-sync after every suspend with toggling the checkbox?
One more question:
Is the time-sync service in the MobyLinux guest running? After some searches and reading some articles I understand, that the Hyper-V is only responsible for correcting the time on guest-startup and so on - this is also working.
The time-sync for a running guest is only working, if time-sync inside the guest is running. See http://www.altaro.com/hyper-v/hyper-v-time-synchronization/
Just looked into my Alpine container and indeed the date is completely off. Unchecking and checking back the time sync in Hyper-V fixed it. But this looks like a proper bug.