ERROR: failed to solve: golang:1.24.0: failed to resolve source metadata for docker.io/library/golang:1.24.0: failed to authorize: failed to fetch oauth token: Post “https://auth.docker.io/token”: dial tcp 108.160.163.117:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
在windows11下docker build,总是出以上问题
FROM golang:1.24.0
WORKDIR /
COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go build -o bk
ENTRYPOINT [ “/bk”, “serve” ]
3 | COPY . .
4 | RUN go env -w GOPROXY=https://goproxy.cn,direct
5 | >>> RUN go build -o bk
6 | ENTRYPOINT [ “/bk”, “serve” ]
ERROR: failed to solve: process “/bin/sh -c go build -o bk” did not complete successfully: exit code: 1
[internal] load metadata for docker.io/library/golang:1.24.0:
ERROR: failed to solve: golang:1.24.0: failed to resolve source metadata for docker.io/library/golang:1.24.0: failed to do request: Head “https://registry-1.docker.io/v2/library/golang/manifests/1.24.0”: dialing registry-1.docker.io:443 container via direct connection because has no HTTPS proxy: connecting to registry-1.docker.io:443: dial tcp 108.160.165.11:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.