Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Private Repo Authentication: use auth token from ~/.dockercfg #104

Closed
olkulyk opened this issue Jun 26, 2015 · 9 comments
Closed

Private Repo Authentication: use auth token from ~/.dockercfg #104

olkulyk opened this issue Jun 26, 2015 · 9 comments

Comments

@olkulyk
Copy link

olkulyk commented Jun 26, 2015

Is it be possible to use auth token from ~/.dockercfg (or ~/.docker/config.json) instead of using plain username/password authentication?

moby/moby#12009

@davidxia
Copy link
Contributor

davidxia commented Aug 3, 2015

@olkulyk It's certainly possible. What's the use case or problem you're looking to solve?

@tonyshearer
Copy link

+1
This is necessary to allow access to Google Container Registry:

gcloud docker -a
mvn docker:push

The first command updates the .dockercfg with temporary access tokens for *.gcr.io. Currently these are not picked up by the docker-maven-plugin, so there is an auth error when accessing the registry.

@ghost
Copy link

ghost commented Aug 21, 2015

+1
my group is using Artifactory as our local docker repository with a service account that only a certain number of users should have access to. Requiring the info in the settings.xml exposes this information unnecessarily.

In addition, I can't get the authentication to work with the edits to settings.xml, fails with "{"error": "Unauthorized getting repository images"}".

Forgot the stack trace:

Exception caught: Error: Status 403 trying to pull repository vertx/vertx3-exec: "{"error": "Unauthorized getting repository images"}" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:docker-maven-plugin:0.2.8:build (docker) on project event-bus-example: Exception caught
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.MojoExecutionException: Exception caught
at com.spotify.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:117)
at com.spotify.docker.BuildMojo.execute(BuildMojo.java:79)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: com.spotify.docker.client.DockerException: Error: Status 403 trying to pull repository vertx/vertx3-exec: "{"error": "Unauthorized getting repository images"}"
at com.spotify.docker.client.AnsiProgressHandler.progress(AnsiProgressHandler.java:51)
at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:822)
at com.spotify.docker.BuildMojo.buildImage(BuildMojo.java:464)
at com.spotify.docker.BuildMojo.execute(BuildMojo.java:271)
at com.spotify.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:115)
... 22 more

@davidxia
Copy link
Contributor

We're definitely open to PRs on this :)

@ravwojdyla
Copy link
Contributor

+1

@buzzo
Copy link

buzzo commented Oct 27, 2015

+1

1 similar comment
@starlight36
Copy link

+1

@mattnworb
Copy link
Member

spotify/docker-client#219 should help provide this.

@davidxia
Copy link
Contributor

This should be addressed by spotify/docker-client#268. I'll close this for now. We can reopen if there are more issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants