Skip to content

Regression in 0.48.1: Execution-level pushRegistry not applied to all images in multi-image builds #1905

@vliska

Description

@vliska

Title: Regression in 0.48.1: Execution-level pushRegistry not applied to all images in multi-image builds

Description:

Issue Description

After upgrading from docker-maven-plugin version 0.44.0 to 0.48.1, the execution-level <pushRegistry> configuration is no longer consistently applied to all images when building multiple images in a single project. The second image defaults to ghcr.io instead of using the configured registry.

Environment

  • Plugin Version (broken): 0.48.1
  • Plugin Version (working): 0.44.0
  • Maven Version: 3.x
  • Docker Version: 29+

Configuration

<plugin>
  <groupId>io.fabric8</groupId>
  <artifactId>docker-maven-plugin</artifactId>
  <version>0.48.1</version>
  <executions>
    <execution>
      <id>push-docker-image</id>
      <goals>
        <goal>push</goal>
      </goals>
      <phase>deploy</phase>
      <configuration>
        <pushRegistry>${docker.push.registry}</pushRegistry>
      </configuration>
    </execution>
  </executions>
  <configuration>
    <pullRegistry>${docker.registry}</pullRegistry>
    <pushRegistry>${docker.push.registry}</pushRegistry>
  </configuration>
</plugin>

<!-- In the actual plugin usage -->
<plugin>
  <groupId>io.fabric8</groupId>
  <artifactId>docker-maven-plugin</artifactId>
  <configuration>
    <images>
      <image>
        <name>mycompany/myapp-service:${project.version}</name>
        <alias>myapp-service</alias>
        <build>
          <dockerFile>Dockerfile-service</dockerFile>
        </build>
      </image>
      <image>
        <name>mycompany/myapp-client:${project.version}</name>
        <alias>myapp-client</alias>
        <build>
          <dockerFile>Dockerfile-client</dockerFile>
        </build>
      </image>
    </images>
  </configuration>
</plugin>

Where ${docker.push.registry} = registry.example.com:8080

Expected Behavior (0.44.0)

Both images should be pushed to the registry specified in the execution-level <pushRegistry> configuration:

  • myapp-serviceregistry.example.com:8080
  • myapp-clientregistry.example.com:8080

Actual Behavior (0.48.1)

The first image pushes correctly, but the second image attempts to push to ghcr.io:

  • myapp-serviceregistry.example.com:8080
  • myapp-clientghcr.io

Build Output

[INFO] --- docker-maven-plugin:0.48.1:push (push-docker-image) @ myapp ---
[INFO] DOCKER> The push refers to repository [registry.example.com:8080/mycompany/myapp-service]
[INFO] DOCKER> 1.0.0-SNAPSHOT: digest: sha256:d331db402730c71f906aae31db1adf8fec0dec6c67be029afb33d28a3c6a0083 size: 6842
[INFO] DOCKER> Pushed mycompany/myapp-service:1.0.0-SNAPSHOT in 40 seconds 
[INFO] DOCKER> The push refers to repository [ghcr.io/mycompany/myapp-client]
[ERROR] DOCKER> Unable to push 'mycompany/myapp-client:1.0.0-SNAPSHOT' to registry 'ghcr.io' : unauthorized: unauthenticated: User cannot be authenticated with the token provided.

Request

Could you please:

  1. Confirm if this is an intentional breaking change or a bug
  2. Document the expected behavior for registry configuration precedence (execution-level vs image-level vs global)
  3. If this is a bug, restore the 0.44.0 behavior where execution-level <pushRegistry> applies to all images

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions