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

后端 未结 15 2182
日久生厌
日久生厌 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:16

    I found this answer after some Googleing. I'm using Windows, so some of the above answers did not apply to my file system.

    Basically run:

    docker-machine ssh default
    echo "nameserver 8.8.8.8" > /etc/resolv.conf
    

    Which just overwrites the existing nameserver used with 8.8.8.8 I believe. It worked for me!

    Based on some comments, you may have to be root. To do that, issue sudo -i.

提交回复
热议问题