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

相關文章
相關標籤/搜索