Accident memo
On Docker Desktop with WSL2 as the backend, apt throws a Release file for is not valid yet
error.
What to do if apt gives a Release file for xxx is not valid yet error in WSL2 integrated Docker for Windows
Time adjustment was effective in the container as a countermeasure when hwclock -s
did not solve the problem with wsl -d
possible distribution, which is the method described in the article.
Windows 10 build 19042 Docker Desktop 2.5.0.1
Execute the following command for the ubuntu: 20.04
container
apt install build-essential
The result is a Release file for xxx is not valid yet
error (probably libc6 failed to log).
There were many articles that the time difference on the WSL side was the cause, so I ran the following command, but it didn't work.
wsl -d docker-desktop
hwclock -s
I decided to solve the problem by adjusting the time with ntpdate
on the container side instead of the WSL side.
ntpdate ntp.nict.jp
I was angry with Can't adjust the time of day: Operation not permitted
. This is due to the container lacking permissions.
Resolved by passing the --privilaged
option to docker run
.
docker run -itd --privilaged --name hoge ubuntu:20.04
It's dangerous because there are too many authorities, but it's a hobby environment, so I'll solve it for the time being. (SYS_TIME, NET_ADMIN was not enough)