0
我試圖建立使用多克爾一個Golang項目,但該過程保持在離開它完成之前,這裏是來自終端的輸出的一部分:泊塢窗退出之前完成Golang項目建設
github.com/kataras/go-template (download)
Fetching https://golang.org/x/crypto/acme/autocert?go-get=1
Parsing meta tags from https://golang.org/x/crypto/acme/autocert?go-get=1 (status code 200)
get "golang.org/x/crypto/acme/autocert": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/acme/autocert?go-get=1
get "golang.org/x/crypto/acme/autocert": verifying non-authoritative meta tag
The command '/bin/sh -c go get -v' returned a non-zero code: 1
我Dockerfile看像這樣:
FROM golang:1.7
RUN mkdir -p $GOPATH/src/bitbucket.org/cram/rolldrove
WORKDIR $GOPATH/src/bitbucket.org/cram/rolldrove
COPY . $GOPATH/src/bitbucket.org/cram/rolldrove
RUN go get -v
RUN go build ./server.go
CMD ["./server"]
請幫忙,我該如何解決這個問題呢?它在工作之前,但是這開始發生。
編輯
與-x標誌重辦
github.com/kataras/go-template (download)
cd .
git clone https://github.com/kataras/go-template /go/src/github.com/kataras/go-template
cd /go/src/github.com/kataras/go-template
git submodule update --init --recursive
cd /go/src/github.com/kataras/go-template
git show-ref
cd /go/src/github.com/kataras/go-template
git submodule update --init --recursive
Fetching https://golang.org/x/crypto/acme/autocert?go-get=1
Parsing meta tags from https://golang.org/x/crypto/acme/autocert?go-get=1 (status code 200)
get "golang.org/x/crypto/acme/autocert": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/acme/autocert?go-get=1
get "golang.org/x/crypto/acme/autocert": verifying non-authoritative meta tag
The command '/bin/sh -c go get -v -x' returned a non-zero code: 1
的問題似乎是這一行:
get "golang.org/x/crypto/acme/autocert": verifying non-authoritative meta tag
嘗試添加一個'-x'去查看究竟哪個命令失敗。 – JimB
謝謝Jim,結果是一樣的......我將用輸出運行-x標誌編輯問題 –
您的docker構建上下文中還有什麼?除了'server.go'之外還添加_any_其他文件嗎?任何git配置?複製Dockerfile並將其發佈到新目錄中,因此您必須在該工作目錄中添加內容。 – JimB