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

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

    I run into the same problem, but neiter uncommenting /etc/default/docker dns entries nor editing the /etc/resolv.conf in the build container or the /etc/docker/daemon.json helps for me.

    But after I build with the option --network=host the resolving was fine again.

    docker build --network=host -t my-own-ubuntu-like-image .
    

    Maybe this will help someone again.

提交回复
热议问题