Docker build “Could not resolve 'archive.ubuntu.com'” apt-get fails to install anything

后端 未结 15 2120
日久生厌
日久生厌 2020-11-28 17:45

I\'ve been trying to run Docker build on various files which previously worked before, which are now no longer working.

As soon as the Docker file included any line

15条回答
  •  渐次进展
    2020-11-28 18:27

    I have struggled for some time with this now as well, but here it is what solved it for me on Ubuntu 16.04 x64. I hope it saves someone's time, too.

    1. In /etc/NetworkManager/NetworkManager.conf: comment out #dns=dnsmasq

    2. Create (or modify) /etc/docker/daemon.json:

    {
        "dns": ["8.8.8.8"]
    }
    
    1. Restart docker with: sudo service docker restart

提交回复
热议问题