Docker build ubuntu 没法执行 apt-get update

之前的Dockerfile从新build时出现没法执行 apt-get update,在宿主机是能够的。html

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

第二种方法:ubuntu

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

参考:ui

相关文章
相关标签/搜索