简体   繁体   中英

Dep xxx restored, but was unable to load it with error: Package xxx not found

I have a golang app inside my-app (cloned git repo). The folder myapp is on the same place as my Dockerfile. I copy my project in it. Here is my 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

Now the godep restore -v is failing. A lot of repo's are restored well, some are skipped:

godep: Restoring dependency ..
godep: Restoring dependency (if needed): github.com/xxx
godep: Skipping already restored repo

It works all fine till the moment it need to restore dependencies which are inside the my-app repo?

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

The path exist (on every branch). When I cd inside my-app I can see the subpath folder and I can also visit it on github:

https://github.com/my-name/my-repo/tree/branch/subpath

What am I missing or what is going wrong?

看起来您没有在Docker容器中设置GOPATH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM