使用spotify / dockerfile-maven-plugin推送Docker集线器时出错
我有一个作为docker镜像构build的maven项目。 我正在使用spotify / dockerfile-maven来构build这个镜像,并将它在mvn clean install
上自动推送到docker.hub。 build
阶段没有任何问题。 但在push
我有这个错误:
[ERROR] denied: requested access to the resource is denied [WARNING] An attempt failed, will retry 1 more times org.apache.maven.plugin.MojoExecutionException: Could not push image at com.spotify.plugin.dockerfile.PushMojo.execute(PushMojo.java:90) ........ Caused by: com.spotify.docker.client.exceptions.DockerException: denied: requested access to the resource is denied at com.spotify.plugin.dockerfile.LoggingProgressHandler.handleError(LoggingProgressHandler.java:105) at com.spotify.plugin.dockerfile.LoggingProgressHandler.progress(LoggingProgressHandler.java:63) ......
这是我的插件configuration:
<build> <pluginManagement> <plugins> <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>1.3.6</version> <configuration> <repository>${docker.image.prefix}/${project.artifactId}-istio</repository> <tag>latest</tag> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>build</goal> <goal>push</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> </build>
当推入docker push image-name:tag
一切正常。
在这里,我find了类似的问题,但添加docker-client v8.8.4
的依赖关系不会改变任何东西。
此外, 这个评论build议切换到1.3.3
版本,但这不适用于我。
对于这两种情况,我都可以在日志中看到它推送到同一个存储库:
The push refers to a repository [docker.io/my-loging/my-image-name]