Docker build ubuntu 无法执行 apt-get update

原创
2019/12/23 12:23
阅读数 1.3K

以前的Dockerfile重新build时出现无法执行 apt-get update,在宿主机是可以的。

找到个攻略,docker build加上--network=host参数,临时解决!

第二种方法:

the problem was with Internet connection, as mine connection is at enterprise level and because of that It was unable to execute apt-get update command. Solution worked for me is :

    find your DNS server address using cat /etc/resolv.conf

    Open Docker confg file and uncomment DOCKER_OPTS and add your DNS server over there

Docker config file : sudo gedit /etc/default/docker

参考:

展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部