LoginSignup
0
0

More than 1 year has passed since last update.

Dockerでapt-get updateするとエラーになる

Posted at

概要

docker-で環境構築中にdocker-compose build押すとapt-get updateでコケる現象があった。

#10 2.636 E: Release file for http://security.debian.org/debian-security/dists/bullseye-security/InRelease is not valid yet (invalid for another 3h 27mi
n 14s). Updates for this repository will not be applied.
#10 2.636 E: Release file for http://deb.debian.org/debian/dists/bullseye-updates/InRelease is not valid yet (invalid for another 6h 41min 1s). Updates
for this repository will not be applied.

エラー原因

WSL内の時間が実際の時間とずれていると起きるエラーらしい。

==環境===
Windows 10 Home
WSL2 (Ubuntu-20.04)

対処方法

Windowsのpowershellを開き、下記コマンドを流してWSLを再起動するだけ。
※shutdownとなっているが、wslは自動で再起動されるので実質再起動コマンドになる

ちなみに1秒くらいで終了するので、すぐ解消できる

$ wsl --shutdown

余談

Docker側も再起動しないと以下のようなエラーが出る場合がある。

$ docker-compose build
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/d
ocker_engine: The system cannot find the file specified.

Dockerをrestartすれば解消される
image.png

以上となります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0