LoginSignup
7
7

More than 5 years have passed since last update.

Docker for Windows でDNS を8.8.8.8へ切り替えてもDocker イメージが取得できない場合の対処方法

Last updated at Posted at 2018-01-28

概要

Windows 10 のDocker for Windows で docker run hello-worldしてもイメージが取得できない

現象

  1. Docker for Windows をインストールし、コンソールで docker run hello-world を実行しても Docker イメージが取得できない。

    PS C:\Windows\system32> docker run hello-world
    Unable to find image 'hello-world:latest' 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'.
    
  2. Firewallに阻まれているわけでもない。

  3. DNS を8.8.8.8へ切り替えてもダメ。

対処方法

  • Windows container へ切り替える。

    タスクバー上のDocker アイコンを右クリックして、「Switch to Windows containers...」と表示されていたらLinux Containerになっています。
    Windows Containers へ切り替えましょう。

    image.png

  • settings 画面の違いでも判ります。

    • Windows Container image.png
    • Linux Container image.png

結果

PS C:\Windows\system32> docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (windows-amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run a Windows Server container with:
 PS C:\> docker run -it microsoft/windowsservercore powershell

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

確認バージョン

  • Windows 10 Pro 1709(16299.192)
  • Docker Community Edition Version 17.12.0-ce-win47 (15139)
7
7
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
7
7