0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker build がエラーでビルドできない(Windows)

Posted at

#この記事は何で解決できたのかわからずに書いてます。すみません。そしてベストプラクティスであるかもわかりません

環境
Windows
Docker desktop

ドッカーを使ってみようと思い動画サイトなどを参考にdocker pullやらを行っていたのですが、
docker build .が通らず下記のエラー文が表示されてしまいました。

エラー文で検索すると皆さん時間のズレが原因とのことで解決されていたのですが、
私は解決されず、、、
うじうじトライ&エラーを行っている際にubuntuのバージョン変えてみるかという思い付きが生まれ
ubuntu:20.04からubuntu:16.04に変えたら通りました。

↓修正前 Dockerfile

From ubuntu:20.04
RUN apt-get update && apt-get install -y \
  curl

↓ターミナルエラー文

 47.84 E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 1d 2h 43min 46s). Updates for this repository will not be applied.
#5 47.84 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 1d 2h 44min 2s). Updates for this repository will not be applied.
#5 47.84 E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 1d 2h 44min 31s). Updates for this repository will not be applied.
#5 ERROR: executor failed running [/bin/sh -c apt-get update && apt-get install -y   curl]: exit code: 100
------
 > [2/2] RUN apt-get update && apt-get install -y   curl:
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y   curl]: exit code: 100

------
 > [2/2] RUN apt-get update && apt-get install -y   curl   nginx:
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y   curl   nginx]: exit code: 100

↓修正後 dockerfile

FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
  curl
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?