3
5

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 for Windowsでproxy設定

Posted at

Docker for Windowsをインストールしてdocker runしたらproxy関係でエラーが出たのでメモ。

環境

  • Windows 10 Enterprise 1903
  • Docker for Windows v19.03.5

発生したエラー

> docker run -it -d --name centos7 centos:centos7
Unable to find image 'centos:centos7' locally
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.

対処

  • マシンが認証付きプロキシ環境下のため環境変数にプロキシを入れたが同じエラーとなった。
  • タスクトレイのDockerアイコンからsettiongsをクリックし、PROXIESの画面を確認。
  • 以下のプロキシ設定を入力し、Apply & Restartをクリック。

http://<user>:<password>@<your-proxy>:<proxy-port>/
※認証付きでない場合は<user>:<password>@を外す。

image.png

これで無事に実行できた。

> docker run -it -d --name centos7 centos:centos7
Unable to find image 'centos:centos7' locally
centos7: Pulling from library/centos
ab5ef0e58194: Pull complete
Digest: sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c
Status: Downloaded newer image for centos:centos7
f2c8f2188ba3260e6ef96f1d73bf0c3fa3ce42eda71cdf1e5dd79df19eac713b
3
5
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
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?