spotify / docker-maven-plugin

INACTIVE: A maven plugin for Docker
Apache License 2.0
2.66k stars 575 forks source link

Pushing with authentication doesn't work with credsStore osxkeychain #328

Closed fakeh closed 6 years ago

fakeh commented 7 years ago

Trying to push a Maven built image to Docker Hub with the authentication details specified in ~/.docker/config.json (as created by docker login) doesn't pull in the correct credentials, resulting in:

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:push (push-image) on project publisher: Exception caught: denied: requested access to the resource is denied -> [Help 1]

Setting up the element in ~/.m2/settings.xml works as expected.

<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<execution>
    <id>push-image</id>
    <phase>deploy</phase>
    <goals>
        <goal>push</goal>
    </goals>
    <configuration>
        <imageName>redbite/${image.name}:${project.version}</imageName>
        <useConfigFile>true</useConfigFile>
    </configuration>
</execution>
$cat ~/.docker/config.json
{
    "auths": {
        "https://index.docker.io/v1/": {}
    },
    "credsStore": "osxkeychain"
}

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T20:39:06+01:00) Maven home: /usr/local/Cellar/maven/3.5.0/libexec Java version: 1.8.0_60, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"

mattnworb commented 7 years ago

see https://github.com/spotify/docker-client/issues/657, support needs to be added to the underlying docker-client library

vijay-js commented 6 years ago

Any workaround or tag in maven to force the plugin to use creds mentioned in of pom.xml

davidxia commented 6 years ago

closed by https://github.com/spotify/docker-maven-plugin/pull/381