'Docker Builds Failing when running go get

All of my docker builds are getting this error when doing a go get. Unfortunately the error message isn't very helpful (or I am struggling to understand it)...

Step 39/75 : RUN cd /go/src/${PROJECT_FOLDER_NAME}/ && go get ./...
 ---> Running in a36eb269a4dd
# golang.org/x/net/http2
../golang.org/x/net/http2/transport.go:417:45: undefined: os.ErrDeadlineExceeded

I turned on verbose in my go get and it wasn't that much more useful. Any thoughts or ideas would be much appreciated:

go.opencensus.io/plugin/ochttp/propagation/b3
golang.org/x/xerrors
# golang.org/x/net/http2
../golang.org/x/net/http2/transport.go:417:45: undefined: os.ErrDeadlineExceeded
google.golang.org/api/googleapi/transport

Thank you very much.



Solution 1:[1]

I met with the same problem today.

Building following docker file gives that same error.

FROM golang:1.14-alpine as fuse
RUN apk add --no-cache git
ENV GOPATH /go
RUN go get -u github.com/googlecloudplatform/gcsfuse

Changing to this solves the problem.

FROM golang:1.17-alpine as fuse
RUN apk add --no-cache git
RUN go install github.com/googlecloudplatform/[email protected]

Solution 2:[2]

I just remove the old docker images and generate a new one, then its working fine to me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Krishna
Solution 2 Anantha Kannan