This is an automated email from the ASF dual-hosted git repository. zixuan pushed a commit to branch branch-as-3.0 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 266c5e08f36bb7a5537d7a5df3ce9a1bb226d8db Author: Zixuan Liu <[email protected]> AuthorDate: Wed May 15 22:31:12 2024 +0800 [improve][build] Support custom image and label names (#22703) Signed-off-by: Zixuan Liu <[email protected]> Co-authored-by: Lari Hotari <[email protected]> (cherry picked from commit 7befb8df945899ef4f047d503aa7fcbde5df245c) Signed-off-by: Zixuan Liu <[email protected]> --- docker/pulsar-all/pom.xml | 6 +++--- docker/pulsar/pom.xml | 4 ++-- pom.xml | 2 ++ tests/docker-images/java-test-image/pom.xml | 5 ++++- tests/docker-images/latest-version-image/Dockerfile | 6 ++++-- tests/docker-images/latest-version-image/pom.xml | 8 ++++++-- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/docker/pulsar-all/pom.xml b/docker/pulsar-all/pom.xml index 82332a1ca92..2d6e0f2467e 100644 --- a/docker/pulsar-all/pom.xml +++ b/docker/pulsar-all/pom.xml @@ -150,17 +150,17 @@ <configuration> <images> <image> - <name>${docker.organization}/pulsar-all</name> + <name>${docker.organization}/${docker.image}-all</name> <build> <contextDir>${project.basedir}</contextDir> <tags> - <tag>latest</tag> + <tag>${docker.tag}</tag> <tag>${project.version}-${git.commit.id.abbrev}</tag> </tags> <args> <PULSAR_IO_DIR>target/apache-pulsar-io-connectors-${project.version}-bin</PULSAR_IO_DIR> <PULSAR_OFFLOADER_TARBALL>target/pulsar-offloader-distribution-${project.version}-bin.tar.gz</PULSAR_OFFLOADER_TARBALL> - <PULSAR_IMAGE>${docker.organization}/pulsar:${project.version}-${git.commit.id.abbrev}</PULSAR_IMAGE> + <PULSAR_IMAGE>${docker.organization}/${docker.image}:${project.version}-${git.commit.id.abbrev}</PULSAR_IMAGE> </args> <buildx> <platforms> diff --git a/docker/pulsar/pom.xml b/docker/pulsar/pom.xml index a3a67b837ee..28a0370d7a5 100644 --- a/docker/pulsar/pom.xml +++ b/docker/pulsar/pom.xml @@ -77,7 +77,7 @@ <configuration> <images> <image> - <name>${docker.organization}/pulsar</name> + <name>${docker.organization}/${docker.image}</name> <build> <args> <PULSAR_TARBALL>target/pulsar-server-distribution-${project.version}-bin.tar.gz</PULSAR_TARBALL> @@ -87,7 +87,7 @@ </args> <contextDir>${project.basedir}</contextDir> <tags> - <tag>latest</tag> + <tag>${docker.tag}</tag> <tag>${project.version}-${git.commit.id.abbrev}</tag> </tags> <buildx> diff --git a/pom.xml b/pom.xml index eae0105f395..4d23b1cd010 100644 --- a/pom.xml +++ b/pom.xml @@ -128,6 +128,8 @@ flexible messaging model and an intuitive client API.</description> <testHeapDumpPath>/tmp</testHeapDumpPath> <surefire.shutdown>kill</surefire.shutdown> <docker.organization>apachepulsar</docker.organization> + <docker.image>pulsar</docker.image> + <docker.tag>latest</docker.tag> <skipSourceReleaseAssembly>false</skipSourceReleaseAssembly> <skipBuildDistribution>false</skipBuildDistribution> <shadePluginPhase>package</shadePluginPhase> diff --git a/tests/docker-images/java-test-image/pom.xml b/tests/docker-images/java-test-image/pom.xml index 65922c35880..1369553a7b5 100644 --- a/tests/docker-images/java-test-image/pom.xml +++ b/tests/docker-images/java-test-image/pom.xml @@ -154,9 +154,12 @@ <image> <name>${docker.organization}/java-test-image</name> <build> + <args> + <PULSAR_IMAGE>${docker.organization}/${docker.image}:${project.version}-${git.commit.id.abbrev}</PULSAR_IMAGE> + </args> <contextDir>${project.basedir}</contextDir> <tags> - <tag>latest</tag> + <tag>${docker.tag}</tag> <tag>${project.version}</tag> </tags> <noCache>true</noCache> diff --git a/tests/docker-images/latest-version-image/Dockerfile b/tests/docker-images/latest-version-image/Dockerfile index 7c663ff6f94..ac4f067b54b 100644 --- a/tests/docker-images/latest-version-image/Dockerfile +++ b/tests/docker-images/latest-version-image/Dockerfile @@ -18,6 +18,8 @@ # # build go lang examples first in a separate layer +ARG PULSAR_ALL_IMAGE +ARG PULSAR_IMAGE FROM golang:1.21 as pulsar-function-go @@ -27,12 +29,12 @@ RUN cd /go/src/github.com/apache/pulsar/pulsar-function-go/pf && go install RUN cd /go/src/github.com/apache/pulsar/pulsar-function-go/examples && go install ./... # Reference pulsar-all to copy connectors from there -FROM apachepulsar/pulsar-all:latest as pulsar-all +FROM $PULSAR_ALL_IMAGE as pulsar-all ######################################## ###### Main image build ######################################## -FROM apachepulsar/pulsar:latest +FROM $PULSAR_IMAGE # Switch to run as the root user to simplify building container and then running # supervisord. Each of the pulsar components are spawned by supervisord and their diff --git a/tests/docker-images/latest-version-image/pom.xml b/tests/docker-images/latest-version-image/pom.xml index ad56eab9819..7b0714ce429 100644 --- a/tests/docker-images/latest-version-image/pom.xml +++ b/tests/docker-images/latest-version-image/pom.xml @@ -152,11 +152,15 @@ <configuration> <images> <image> - <name>${docker.organization}/pulsar-test-latest-version</name> + <name>${docker.organization}/${docker.image}-test-latest-version</name> <build> <contextDir>${project.basedir}</contextDir> + <args> + <PULSAR_IMAGE>${docker.organization}/${docker.image}:${project.version}-${git.commit.id.abbrev}</PULSAR_IMAGE> + <PULSAR_ALL_IMAGE>${docker.organization}/${docker.image}-all:${project.version}-${git.commit.id.abbrev}</PULSAR_ALL_IMAGE> + </args> <tags> - <tag>latest</tag> + <tag>${docker.tag}</tag> <tag>${project.version}</tag> </tags> <noCache>true</noCache>
