2014年6月27日 星期五

解決 Docker DNS 查詢不到問題

Problem:

Error response from daemon: Get https://index.docker.io/v1/search?q=ubuntu: dial tcp: lookup index.docker.io: no DNS servers

Answer 1:

add name server 127.0.0.1 to /etc/resolv.conf

vim /etc/resolv.conf
nameserver 127.0.0.1
nameserver 8.8.8.8

service docker restart

Answer 2:
add name server 127.0.0.1 to /etc/network/interfaces

vim /etc/network/interfaces
dns-nameservers 127.0.0.1

ifdown eth0 && ifup eth0

service docker restart