【问题标题】:Docker tutorial (getting started) build fails (times out at STEP 2 of Dockerfile)Docker教程(入门)构建失败(在Dockerfile的STEP 2超时)
【发布时间】:2022-11-30 03:16:15
【问题描述】:

我正在尝试在 ubuntu 上构建“入门”docker 教程的容器映像,但在 Dockerfile 的第二步构建失败

RUN apk add --no-cache python2 g++ make

更具体地说,它无法获取一些.tar.gz文件来自https://dl-cdn.alpinelinux.org/导致超时:

fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: operation timed out
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: operation timed out

然后由于缺少包而导致错误。

我可以从手动下载文件https://dl-cdn.alpinelinux.org/网站所以我不明白获取失败。

这怎么能解决? 谢谢

【问题讨论】:

    标签: docker ubuntu docker-build


    【解决方案1】:

    如我所料,问题的根源有些愚蠢我在安装过程中犯的错误.我在 linux 安装后过程中遇到了一些麻烦,所以我开始做事时并没有完全理解我在做什么。

    更具体地说,我将 docker(在 ~/.docker/config.json 中)配置为使用代理服务器甚至以为我不在后面。一旦我从配置文件中删除了以下几行(我自己首先放在那儿),一切正常。

    {
     "proxies":
     {
       "default":
       {
         "httpProxy": "http://192.168.1.12:3128",
         "httpsProxy": "http://192.168.1.12:3128",
         "noProxy": "*.test.example.com,.example2.com,127.0.0.0/8"
       }
     }
    }
    

    【讨论】:

      猜你喜欢
      • 2022-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      • 1970-01-01
      • 2018-01-17
      • 2021-04-23
      • 1970-01-01
      相关资源
      最近更新 更多