Getting 'Release is not valid yet' while updating ubuntu docker container

Restart docker (or your computer to be certain) as the system clock is mismatched.

I spent few hours trying to figure what was going and restarting fixed it instantly.


Correct your system clock. (in comments I also suggested checking for a mismatch between clock and your timezone too)

Refer to What is the command line statement for changing the System clock? for setting system time (I suggest going to the timedatectl answer if using a 'modern' Ubuntu release), or http://manpages.ubuntu.com/manpages/xenial/man8/hwclock.8.html (if you want to set hardware clock directly; but remember to match it up with your timezone config)


If you are using Docker, a bug was recently introduced in 2.2.0 that causes time drift when the host computer goes to sleep. This desynchronizes all running docker containers, resulting in errors such as this one.

See https://github.com/docker/for-win/issues/5593 for tracking the solution and workarounds.

This was asked in 2018, when this bug was not present in Docker yet. Now, this bug is present, so this bug may be the problem for people finding this post today.