Defined GOPROXY not being used

467 Views Asked by At

I'm trying to download artifacts from github.com through my company proxy for go artifacts. Below is the command I've defined in the docker file for downloading buf

RUN GOPROXY=https://go.ci.artifacts.company.com/artifactory/golang-go-release-remote,direct go install \
    github.com/bufbuild/buf/cmd/[email protected]

But the build fails with the below error

13:28:10  ---> Running in 829d352a2aa5
13:28:15 go: github.com/klauspost/[email protected]: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.16.7.zip: 403 Forbidden
13:28:18 Could not build image: The command '/bin/sh -c go mod download' returned a non-zero code: 1

Can someone help me with the reason for why the defined proxy is not used & the downloaded is attempted using https://proxy.golang.org/github.com ?

Also I've tried adding below commands in the docker file before download but the defined proxy is not used

ENV GO111MODULE=on
RUN go mod init

as per the comments in the question "go get" ignores GOPROXY when using http_proxy

0

There are 0 best solutions below