The ssh container appears to have the same time sync issue that has plagued Docker for Mac since they switched the implementation to HyperKit (at least that far back), namely that if the host Mac goes to sleep, the container's time does not keep up and will fall behind the host. Unfortunately, in my case, at least, restarting the container does not fix the issue.
That's just a small sample of the issues that have been reported and/or filed on upstream. It seems unlikely they'll fix it anytime soon. In the meantime, perhaps it would help to run ntpd in the container and to run ntpdate on restart.
The ssh container appears to have the same time sync issue that has plagued Docker for Mac since they switched the implementation to HyperKit (at least that far back), namely that if the host Mac goes to sleep, the container's time does not keep up and will fall behind the host. Unfortunately, in my case, at least, restarting the container does not fix the issue.
This behavior is not unique to your container:
https://www.reddit.com/r/docker/comments/58ozxh/ntp_in_the_container_or_sync_with_host/ https://github.com/docker/for-mac/issues/17 https://github.com/docker/for-mac/issues/500 https://github.com/docker/for-mac/issues/693 https://github.com/docker/docker/issues/27488
That's just a small sample of the issues that have been reported and/or filed on upstream. It seems unlikely they'll fix it anytime soon. In the meantime, perhaps it would help to run
ntpd
in the container and to runntpdate
on restart.