我在 my-app
中有一个 golang 应用程序(克隆的 git repo)。文件夹 myapp 与我的 Dockerfile 位于同一位置。我将我的项目复制到其中。
这是我的 dockerfile:
FROM golang:1.7
RUN go get github.com/tools/godep
ADD priv/.netrc /root/.netrc
WORKDIR /go/src/my-app
ADD ./my-app .
RUN godep restore -v
现在 godep restore -v 失败了。 很多 repo 都恢复得很好,有些被跳过了:
godep: Restoring dependency ..
godep: Restoring dependency (if needed): github.com/xxx
godep: Skipping already restored repo
在需要恢复 my-app
存储库中的依赖项之前,一切正常吗?
godep: Dep (github.com/otherrepo/random/random) restored, but was unable to load it with error:
Package (github.com/my-name/my-app/subpath) not found
路径存在(在每个分支上)。
当我在 my-app 中 cd
时,我可以看到 subpath
文件夹,我也可以在 github 上访问它:
https://github.com/my-name/my-repo/tree/branch/subpath
我错过了什么或出了什么问题?
最佳答案
看起来你没有在 Docker 容器中设置 GOPATH
关于git - Dep xxx 已恢复,但无法加载,错误为 : Package xxx not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45894917/