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

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

    On my system (macOS High Sierra 10.13.6 with Docker 2.1.0.1) this was due to a corporate proxy.

    I solved this by two steps:

    1. Manually configure proxy settings in Preferences>Proxies
    2. Add the same settings to your config.json inside ~/.docker/config.json like:

       "proxies":
      {
        "default":
        {
          "httpProxy": "MYPROXY",
          "httpsProxy": "MYPROXY",
          "noProxy": "MYPROXYWHITELIST"
        }
      }
      

提交回复
热议问题