-
Notifications
You must be signed in to change notification settings - Fork 657
Open
Description
Description
When using docker.build.jib = trueto delegate image building to Jib, the plugin fails to push to private registries with authentication errors, despite credentials being properly configured in Maven's settings.xml. The same configuration works correctly when using native Docker mode (docker.build.jib = false).
Error Message
[ERROR] DOCKER> Exception occurred while pushing the image: <ip:port>/knowledge-platform:1.0.0, Required credentials for <ip:port>/knowledge-platform were not sent because the connection was over HTTP
[ERROR] DOCKER> Exception occurred while pushing the image: <ip:port>/knowledge-platform:1.0.0
[ERROR] DOCKER> Error when push JIB image [Required credentials for <ip:port>/knowledge-platform were not sent because the connection was over HTTP]stack
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.48.0:push (docker-push) on project knowledge-platform-boot: Error when push JIB image: Required credentials for <ip:port>/knowledge-platform were not sent because the connection was over HTTP -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.48.0:push (docker-push) on project knowledge-platform-boot: Error when push JIB image
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Error when push JIB image
...
Caused by: java.lang.IllegalStateException: Required credentials for <ip:port>/knowledge-platform were not sent because the connection was over HTTP
...
Caused by: com.google.cloud.tools.jib.registry.RegistryCredentialsNotSentException: Required credentials for <ip:port>/knowledge-platform were not sent because the connection was over HTTPPlugin Configuration
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.48.0</version>
<configuration>
<!-- Docker 服务端连接配置 -->
<dockerHost>npipe:////./pipe/podman-machine-default</dockerHost>
<!-- 是否开启TLS验证 -->
<!-- <dockerTlsVerify>false</dockerTlsVerify>-->
<!-- 冗余日志 -->
<verbose>false</verbose>
<!-- registry 拉取或推送时获取认证信息(放入settings.xml) -->
<useColor>true</useColor>
<images>
<!-- 推送到服务器 -->
<image>
<name>${docker.image.name}</name>
<build>
<from>${docker.mirror}/eclipse-temurin:21-jre</from>
<workdir>/app</workdir>
<env>
<TZ>Asia/Shanghai</TZ>
<JAVA_OPTS>-Xms256m -Xmx512m</JAVA_OPTS>
</env>
<assembly>
<descriptorRef>artifact</descriptorRef>
<targetDir>/app</targetDir>
</assembly>
<ports>
<port>8080</port>
<port>5005</port> <!-- 调试端口(可选) -->
</ports>
<cmd>
<shell>java $JAVA_OPTS -jar /app/${project.build.finalName}.jar</shell>
</cmd>
<!-- 镜像元数据 -->
<labels>
<app.name>${spring.application.name}</app.name>
<app.version>${project.version}</app.version>
</labels>
</build>
</image>
<!-- 推送到阿里云 -->
<image>
<name>${docker.image.name.aliyun}</name>
<build>
<from>${docker.mirror}/eclipse-temurin:21-jre</from>
<workdir>/app</workdir>
<env>
<TZ>Asia/Shanghai</TZ>
<JAVA_OPTS>-Xms256m -Xmx512m</JAVA_OPTS>
</env>
<assembly>
<descriptorRef>artifact</descriptorRef>
<targetDir>/app</targetDir>
</assembly>
<ports>
<port>8080</port>
<port>5005</port> <!-- 调试端口(可选) -->
</ports>
<cmd>
<shell>java $JAVA_OPTS -jar /app/${project.build.finalName}.jar</shell>
</cmd>
<!-- 镜像元数据 -->
<labels>
<app.name>${spring.application.name}</app.name>
<app.version>${project.version}</app.version>
</labels>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>docker-push</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>Maven Settings.xml
<servers>
<!-- 配置 Docker 注册表的用户名和密码 -->
<server>
<id><ip:port></id>
<username>user</username>
<password>pwd</password>
</server>
<server>
<id>registry.cn-xxx.aliyuncs.com</id>
<username>user</username>
<password>pwd</password>
</server>
</servers>Others
At the same time, I want to know whether g can configure multiple registries and what can be used to separate them for identification.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels