Skip to content

captain build fails where docker build succeeds on private images in dockerhub #28

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

Closed
grimesjm opened this issue Oct 21, 2015 · 3 comments
Milestone

Comments

@grimesjm
Copy link

CAPTAIN] Building image indigobio/rules:latest
Step 0 : FROM indigobio/deps:latest
Pulling repository docker.io/indigobio/deps
Error: image indigobio/deps:latest not found

docker build -t indigobio/rules .
Sending build context to Docker daemon 8.008 MB
Step 0 : FROM indigobio/deps:latest
latest: Pulling from indigobio/deps

2fad5d366fbd: Already exists

If the image is already pulled then captain build will work fine. I can also push my private images through captain push no problem. Any thoughts?

@grimesjm
Copy link
Author

Running captain build while setting CIRCLECI to true works correctly since it seems to be shelling out to docker directly(I'm not very familiar with GO).

Seems like it's either a go-dockerclient issue or a problem with how captain invokes it.

@grimesjm
Copy link
Author

Ok so here's what I've found.
Based on this test: https://github.com/fsouza/go-dockerclient/blob/master/build_test.go#L116-L125
You can pass AuthConfigurations into the docker client. It doesn't seem by default it uses the .dockercfg on its own.

There is a separate function here: https://github.com/fsouza/go-dockerclient/blob/master/auth.go#L50
that allows you to fetch the AuthConfigurations for .dockercfg.

So if we change this:

https://github.com/harbur/captain/blob/master/docker.go#L33-L41

To also invoke the function to return the dockercfg settings I think it would work.

@ghost
Copy link

ghost commented Oct 23, 2015

yes, with CIRCLECI it shells out to docker (they have their custom docker binary).

I was expecting it to be transparent from the go-dockerclient library user point of view.

It shouldn't be difficult to add it here.

dkapanidis added a commit that referenced this issue May 20, 2016
Fixes #28

In order for captain to be able to download parent images during docker build
it needs to instruct docker client to use ~/.docker/ configuration if it exists.
@dkapanidis dkapanidis added this to the 1.0.0 milestone May 20, 2016
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

2 participants