make docker 時執行到命令RUN apt-get update && apt-get install -y netcat && rm -rf /var/cache/apt 時出現以下錯誤
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
網上大多的解決方案是修改/etc/resolv.conf ,添加nameserver。
在我的測試環境上實際上是不好使的。
修改以下文件
sudo vim /etc/default/docker
將 DOCKER_OPTS前的#去掉,使
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" 生效。
重啓docker
sudo service docker restart
然後重新執行 make docker 。