docker生成错误:https://dl-cdn.alpinelinux.org/alpine/v3.14/commu



大家好,当我试图在ubuntu 22 vm 中构建docker镜像时,我遇到了wierd问题

[+] Building 10.6s (5/14)                                                                                                                        
=> [internal] load build definition from Dockerfile                                                                                        0.0s
=> => transferring dockerfile: 864B                                                                                                        0.0s
=> [internal] load .dockerignore                                                                                                           0.0s
=> => transferring context: 2B                                                                                                             0.0s
=> [internal] load metadata for docker.io/kong/kong:2.7.0                                                                                  0.0s
=> CACHED [ 1/12] FROM docker.io/kong/kong:2.7.0                                                                                           0.0s
=> ERROR [ 2/12] RUN apk update && apk add git unzip luarocks                                                                             10.5s
------                                                                                                                                           
> [ 2/12] RUN apk update && apk add git unzip luarocks:                                                                                         
#0 0.240 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz                                                           
#0 5.245 ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/main: temporary error (try again later)                                              
#0 5.283 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz                                                      
#0 10.29 ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/community: temporary error (try again later)                                         
#0 10.48 v3.14.3-58-g7fc21b9dfb [https://dl-cdn.alpinelinux.org/alpine/v3.14/main]
#0 10.48 v3.14.3-57-g005638434d [https://dl-cdn.alpinelinux.org/alpine/v3.14/community]
#0 10.48 2 errors; 14942 distinct packages available
------
failed to solve: executor failed running [/bin/sh -c apk update && apk add git unzip luarocks]: exit code: 2

docker版本Docker version 20.10.18, build b40c2f6

尝试重新启动docker引擎,但没有成功

添加network=host修复了我的问题

build:
context: ../kong2
network: host

相关内容

最新更新