docker build が急にできないときの対処。なんか他にあるかもしれないけど。。
結論
Client.Timeout発生
↓
docker restartしたら治った。
環境
- Windows10
- Hyper-Vにdockerインストール
状況
request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
というのが発生してdocker buildが正常終了しない。
> docker build .
Sending build context to Docker daemon 28.46MB
Step 1/5 : From python:3
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
対処
dockerのrestart
タスクバーのdockerアイコンで右クリック。
このタイミングでシーンとしているけど、再起動中。↓
ちょっと時間かかる。
再起動終わったらピローンとアラートが出る。
こんなふうになったらOK。
docker restart後
> docker build .
Sending build context to Docker daemon 28.46MB
Step 1/5 : From python:3
3: Pulling from library/python
5ae19949497e: Pull complete
ed3d96a2798e: Pull complete
f12136850781: Pull complete
1a9ad5d5550b: Pull complete
6f18049a0455: Pull complete
ce39fa9d79d1: Pull complete
3a91ffcf88ea: Pull complete
ee82cc8e1506: Pull complete
bf0dbf90a115: Pull complete
Digest: sha256:87fd2bad3de70a5e779a91d7e2ec2bd01115dfe3faf97dacf730a7f4155d11d8
Status: Downloaded newer image for python:3
---> 42d620af35be
(省略)
Step 5/5 : RUN pip install --upgrade pip
---> Running in 2e235b67b06f
Requirement already up-to-date: pip in /usr/local/lib/python3.7/site-packages (19.1.1)
Removing intermediate container 2e235b67b06f
---> fedda0f62e54
Successfully built fedda0f62e54