Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use packages in private repositories #18

Open
bbrks opened this issue Dec 18, 2015 · 0 comments
Open

Unable to use packages in private repositories #18

bbrks opened this issue Dec 18, 2015 · 0 comments

Comments

@bbrks
Copy link

bbrks commented Dec 18, 2015

Not sure if this is possible, feasible, or even out of scope, as my project does not strictly follow the sample hierarchy... But I'm trying to build docker images for a bunch of microservices. All of these microservices share a single authentication middleware function.

All of these services are stored in separate private repositories. When I try using golang-builder, I get 403s from the imported private repos for obvious reasons.

$ docker run --rm -v "$(pwd):/src" -v /var/run/docker.sock:/var/run/docker.sock centurylink/golang-builder
# cd .; git ls-remote https://bitbucket.org/xxx/auth
fatal: could not read Username for 'https://bitbucket.org': No such device or address
# cd .; hg identify https://bitbucket.org/xxx/auth
abort: HTTP Error 404: Not Found
package bitbucket.org/xxx/auth/middleware: https://api.bitbucket.org/1.0/repositories/xxx/auth: 403 FORBIDDEN

Is it possible to either;
a) use git/ssh credentials in build image
b) copy third-party imports from the $GOPATH/src directory at the same time as $(pwd), and use them in the build, then run a "go get" for any missing public imports.

I have found a workaround, by locally cross-compiling to linux, then running docker build myself, but this does have drawbacks... The person doing the build needs Go installed to compile stuff. Using golang-builder, anybody with Docker can run the build.

GOOS="linux" go build
docker build -t yyyservice
docker-compose up
@bbrks bbrks changed the title Unable to use packages with private repositories Unable to use packages in private repositories Dec 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant