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

Allow auth config in pom while pulling from public repo and pushing to private on CI #301

Closed
oli99sc opened this issue Oct 7, 2015 · 4 comments

Comments

@oli99sc
Copy link

oli99sc commented Oct 7, 2015

I pull a java:8 image from default repo and push to a private self hosted repo requiring authentication.
If I add authConfig to image config, the plugins seams to use this auth also for pulling from docker.io, which fails.

One option would be to allow per repository credentials in authConfig pom section. Similar to settings.xml server settings. As we are using several private docker repos, I hesitate to spam our CIs settings.xml with repository credentials.
Another option could be the solution of Issue #147 when taking auth from .docker/config.json. Than I could use docker command line login in my CI config to set the auth for my private repo

@rhuss
Copy link
Collaborator

rhuss commented Oct 7, 2015

Yeah, you are completely right. The pulling issue is also addressed in #147 and already fixed for 0.13.6-SNAPSHOT. For pulling this means, authentication is used only when a default login for the registry is configured and it is not extracted from the image name anymore (which was the bug).

For 0.13.6 I will implement #147 completely so the auth can come from a docker login, too, as you suggest.

In the meantime, you could also provide the credential as well as the user as properties docker.username and docker.password from the outside, too (however these would be used for pull as well). Also, you can simulate somewhat the multiple-credentials-per-repo thingy by using profiles, switching to the proper configuration by selecting a profile by triggering it base on the repository value set.

@oli99sc
Copy link
Author

oli99sc commented Oct 7, 2015

Hi, thanks for the quick reply.
Profiles won't help, as I bind docker build to package phase and push to deploy phase in maven, which makes all happen in the same call to maven. (And I once was told by a colleague that maven profiles are not intended for changing behavior of the build but to adapt to different platforms :-)..)
So maybe I wait for the 0.13.6 release and use docker cli directly until then to push

@gauravarora
Copy link

This would be nice to see fixed. How is everyone working around this right now?

@rhuss
Copy link
Collaborator

rhuss commented Aug 29, 2017

This is already fixed since a long time, sorry for forgetting to close this issue.

You can use different auth for push and pull, and you can also specify the auth per registry in your settings.xml. See https://dmp.fabric8.io/#authentication for all the details.

@rhuss rhuss closed this as completed Aug 29, 2017
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

3 participants