package-feeds icon indicating copy to clipboard operation
package-feeds copied to clipboard

docker build error

Open YouSeeYouOneDayDayDe opened this issue 2 years ago • 3 comments

When I run the command "docker build . -t local-package-feeds", an error occured as follows:

DEPRECATED: The legacy builder is deprecated and will be removed in a future release. BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0 environment-variable.

Sending build context to Docker daemon 603.6kB Step 1/10 : FROM golang:1.20.5-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572 as builder ---> c94784fe2595 Step 2/10 : WORKDIR /app ---> Using cache ---> 0e46dc699e16 Step 3/10 : ENV CGO_ENABLED=0 ---> Using cache ---> a423716eb306 Step 4/10 : COPY go.* ./ ---> Using cache ---> 8d30d18e463c Step 5/10 : RUN go mod download ---> Using cache ---> 0ccb387d027b Step 6/10 : COPY . ./ ---> Using cache ---> 9686bb44b90d Step 7/10 : RUN go build -mod=readonly -v -o server ./cmd/scheduled-feed ---> Using cache ---> e21bd3134248 Step 8/10 : FROM gcr.io/distroless/base:nonroot Get "https://gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

It seems that the domain can not be connected, how to solve this problem?

YouSeeYouOneDayDayDe avatar Jan 12 '24 10:01 YouSeeYouOneDayDayDe

Hi, I tried to reproduce the this issue and it appears to have gone away.

I suspect the gcr.io connection issue was transient.

Please try again, and let me know if the issue still persists.

calebbrown avatar Jan 15 '24 00:01 calebbrown

I tried again, but the problem still persists. I tried to access the website “https://gcr.io/v2/” in browser, and the raw data returned by server is as follows.

{"errors":[{"code":"UNAUTHORIZED","message":"Unauthorized access."}]}

The request headers are as follows.

Accept	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding	gzip, deflate, br
Accept-Language	en-US,en;q=0.5
Connection	keep-alive
Host	gcr.io
Sec-Fetch-Dest	document
Sec-Fetch-Mode	navigate
Sec-Fetch-Site	none
Sec-Fetch-User	?1
Upgrade-Insecure-Requests	1
User-Agent	Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0

the response headers are as follows

X-Firefox-Spdy	h2
alt-svc	h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
cache-control	private
content-encoding	gzip
content-length	84
content-type	application/json
date	Mon, 15 Jan 2024 14:23:05 GMT
docker-distribution-api-version	registry/2.0
server	Docker Registry
www-authenticate	Bearer realm="https://gcr.io/v2/token",service="gcr.io"
x-frame-options	SAMEORIGIN
x-xss-protection	0

Is there anything wrong with my network connection or project configuration? I haven't made any changes to any files in this project.

YouSeeYouOneDayDayDe avatar Jan 15 '24 15:01 YouSeeYouOneDayDayDe

  1. Does docker pull gcr.io/distroless/base:nonroot generate the same response?
  2. Have you tried running docker build . -t local-package-feeds on a different host?
  3. Have you tried restarting your machine and trying again?
  4. If you have any proxies configured, try and connect directly.

As far as I can tell this is not an issue with the package-feeds project. A search of the web shows this as an occasional problem for other docker users.

calebbrown avatar Jan 16 '24 21:01 calebbrown