Docker构建在运行go get时失败。

huangapple go评论85阅读模式
英文:

Docker Builds Failing when running go get

问题

当我进行go get时,我的所有Docker构建都出现了这个错误。不幸的是,错误消息并不是很有帮助(或者我很难理解它)...

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

我在我的go get中打开了详细模式,但它并没有提供太多有用的信息。如果你有任何想法或建议,将不胜感激:

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

非常感谢。

英文:

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.

答案1

得分: 2

我今天遇到了同样的问题。

构建以下 Docker 文件会导致相同的错误。

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

将其更改为以下内容可以解决问题。

FROM golang:1.17-alpine as fuse
RUN apk add --no-cache git
RUN go install github.com/googlecloudplatform/gcsfuse@v0.37.0
英文:

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/gcsfuse@v0.37.0

答案2

得分: 0

我刚刚删除了旧的Docker镜像并生成了一个新的,现在它对我来说正常工作。

英文:

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

huangapple
  • 本文由 发表于 2021年11月3日 01:33:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/69814672.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定