Skip to content

Conversation

@nodece
Copy link
Member

@nodece nodece commented Jan 29, 2026

Motivation

When pushing images to Docker Hub, the docker-maven-plugin currently builds the image twice: once during the build goal and again during the push goal. This results in redundant work and unnecessary build time.

This change makes the Docker goal configurable so that the image is built only once when pushing.

Modifications

  • Replaced the hardcoded Docker goals (build and push) in the default execution of the Docker Maven plugin with the ${docker.goal} property in both docker/pulsar/pom.xml and docker/pulsar-all/pom.xml, allowing the active goal to be configured.
  • Set the default value of the docker.goal property to build in the root pom.xml, preserving the existing behavior for normal builds.
  • Added the docker.goal=push property to the docker-push Maven profile in both docker/pulsar/pom.xml and docker/pulsar-all/pom.xml, so activating this profile pushes the image without triggering an extra build.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 29, 2026
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lhotari
Copy link
Member

lhotari commented Jan 29, 2026

/pulsarbot rerun-failure-checks

@lhotari lhotari changed the title [improve][docker] Build image only once when pushing [improve][build] Build docker image only once when pushing Jan 29, 2026
@nodece nodece merged commit d0efdd7 into apache:master Jan 30, 2026
161 of 174 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants