LoginSignup
21
15

More than 5 years have passed since last update.

Docker for windowsでtimeout errorしたときの処理

Posted at

はじめに

Windows 10 home にてdocker toolboxを使いDockerFileからbuildしようしたらこのようなエラーが出ました。

docker build -t <name>/nginx:1.0 .
Sending build context to Docker daemon  3.072kB
Step 1/3 : FROM nginx
Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: read udp 10.0.2.15:48321->10.0.2.3:53: i/o timeout

原因

調べたところDockerホストのDNSが問題らしいです。

解決法

$ docker-machine ssh default
$ sudo vi /etc/resolv.conf

でvm内部に入ります。

$ sudo vi /etc/resolv.conf

そしてresolv.confを編集します.

resolv.conf
nameserver 10.0.2.3

となっているので

resolv.conf
nameserver 8.8.8.8

と変更します
あとは>exitでvmから抜け出しbuildすると無事成功しました。

21
15
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
21
15