You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Description:
When running a docker build -t my-app-name . command, the go mod download step is triggered to install project dependencies. However, an error is encountered during this process that prevents successful dependency installation. The specific error message is as follows:
=> ERROR [4/7] RUN go mod download 2.7s
------
> [4/7] RUN go mod download:
2.588 go: github.com/gabriel-vasile/[email protected]: reading https://proxy.golang.org/github.com/gabriel-vasile/mimetype/@v/v1.4.2.zip: 403 Forbidden
------
Dockerfile:9
--------------------
7 | # Download Go modules
8 | COPY go.mod go.sum ./
9 | >>> RUN go mod download
10 |
11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c go mod download" did not complete successfully: exit code: 1```
Expected Behavior:
The go mod download step should successfully install the project dependencies without encountering any errors related to the github.com/gabriel-vasile/mimetype dependency.
Actual Behavior:
The go mod download step encounters a 403 Forbidden error when trying to access the following URL: https://proxy.golang.org/github.com/gabriel-vasile/mimetype/@v/v1.4.2.zip
Additional Context:
When attempting to access the URL https://proxy.golang.org/github.com/gabriel-vasile/mimetype/@v/v1.4.2.zip directly from the browser on my laptop, I can confirm that I can access the URL without any issues. The zip file downloads successfully.
Furthermore, when I use the wget command on my server (which is hosted at Hetzner and utilizes an ARM processor), I am also able to successfully download the zip file without encountering any access restrictions or errors.
It seems that the issue is isolated to the environment of running a docker build on my server. It's puzzling that I can access the URL from various contexts except during the Docker build process. This might suggest that there could be a specific configuration or network-related factor within the Docker build environment that's causing this 403 Forbidden error. But I don't know why, because all others dependencies download well
I have the same issue when I run go mod tidy instead of go mod download
Dockerfile:
FROM golang:1.21
WORKDIR /app
# Download Go modulesCOPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY xxxx-api.conf /app/.env
RUN CGO_ENABLED=0 GOOS=linux go build -o api
EXPOSE 8080
CMD ["./api"]
Environment Details:
Operating System: Debian 12
Docker Version: Docker version 24.0.5, build ced0996
The text was updated successfully, but these errors were encountered:
ljahier
changed the title
Issue with go mod tidy during Docker build due to github.com/gabriel-vasile/mimetype
Issue with go mod download during Docker build due to github.com/gabriel-vasile/mimetype
Aug 28, 2023
ljahier
changed the title
Issue with go mod download during Docker build due to github.com/gabriel-vasile/mimetype
Cannot download library in docker build
Aug 28, 2023
Hello,
Issue Description:
When running a
docker build -t my-app-name .
command, thego mod download
step is triggered to install project dependencies. However, an error is encountered during this process that prevents successful dependency installation. The specific error message is as follows:Expected Behavior:
The
go mod download
step should successfully install the project dependencies without encountering any errors related to thegithub.com/gabriel-vasile/mimetype
dependency.Actual Behavior:
The
go mod download
step encounters a403 Forbidden
error when trying to access the following URL:https://proxy.golang.org/github.com/gabriel-vasile/mimetype/@v/v1.4.2.zip
Additional Context:
When attempting to access the URL
https://proxy.golang.org/github.com/gabriel-vasile/mimetype/@v/v1.4.2.zip
directly from the browser on my laptop, I can confirm that I can access the URL without any issues. The zip file downloads successfully.Furthermore, when I use the
wget
command on my server (which is hosted at Hetzner and utilizes an ARM processor), I am also able to successfully download the zip file without encountering any access restrictions or errors.It seems that the issue is isolated to the environment of running a
docker build
on my server. It's puzzling that I can access the URL from various contexts except during the Docker build process. This might suggest that there could be a specific configuration or network-related factor within the Docker build environment that's causing this403 Forbidden
error. But I don't know why, because all others dependencies download wellI have the same issue when I run
go mod tidy
instead ofgo mod download
Dockerfile:
Environment Details:
The text was updated successfully, but these errors were encountered: