The system time in WSL is out of sync with your Windows system time. Docker containers launched from WSL suffer from the same incorrect time, which they inherit from WSL. I've observed this in WSL2 Ubuntu in Windows 10.
We can use
ntpdate to update the date & time according to some source we trust. Generally running an
ntpd daemon is preferred over using
ntpdate, but it's quick and does the job and I'm not worried about issues with running services getting confused about living in a different time all of a sudden.
If this command gives
Command 'ntpdate' not found, run
sudo apt install ntpdate.
sudo ntpdate time.windows.com
Note: Other NTP servers can be found on the NTP Pool Project website.
date to verify the date & time are now correct.