Skip to content

How to fix time drift in docker

How to fix time drift in docker published on No Comments on How to fix time drift in docker

Sharing is caring!

Problem

You have docker running on your machine and after setting your laptop into standby a couple of times the docker time is running behind the local machine time. I noticed this when using portainer (I love that tool so I use it a lot) but when logging in I got the “Your session has expired” message when wanting to login. a docker reboot fixed it but I’ve got more containers running and don’t want to have t reboot all…

This happens on my Mac when working with docker ‘native’:

  • Version 1.13.1-rc1-beta40 (15241)
  • Channel: beta
  • 0d026e19d7

Solution

  • Enter the ‘native’ image of docker and run hwclock -s

  • leave screen by pressing ctrl+a,d (keep ctrl pressed and then in sequence a,d)

Now you have a way to fix it without having to restart docker. This is a bug though so I hope docker fixes it soon…

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar