Spotify docker-maven-plugin未经授权:身份验证需要公开回购

时间:2016-10-07 19:27:57

标签: maven docker maven-plugin spotify docker-registry

我无法使用以下命令将Docker镜像推送到集线器:

mvn clean package docker:build -DpushImage

每次我收到以下回复:

[WARNING] Failed to push jdruwe/k8s-product-owner, retrying in 10 seconds (5/5).

...

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project k8s-product-owner: Exception caught: unauthorized: authentication required -> [Help 1]

当我尝试使用以下命令之一登录时,我不断收到错误登录成功

docker login -u jdruwe https://index.docker.io/v1/

OR

docker login

我确实在集线器上创建了一个空的仓库,只是为了尝试修复它:

enter image description here

有什么想法吗?

1 个答案:

答案 0 :(得分:8)

您是否正确配置了身份验证设置?

用户名和密码可以在 settings.xml 中设置:

LEFT OUTER JOIN

然后, pom 引用这些设置:

<servers>
  <server>
    <id>docker-hub</id>
    <username>jdruwe</username>
    <password>secret-password</password>
    <configuration>
      <email>foo@foo.bar</email>
    </configuration>
  </server>
</servers>

可在此处找到更详细的信息:https://github.com/spotify/docker-maven-plugin#authenticating-with-private-registries