This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 7befb8df945 [improve][build] Support custom image and label names 
(#22703)
7befb8df945 is described below

commit 7befb8df945899ef4f047d503aa7fcbde5df245c
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]>
---
 docker/pulsar-all/pom.xml                           | 6 +++---
 docker/pulsar/pom.xml                               | 4 ++--
 pom.xml                                             | 2 ++
 tests/docker-images/java-test-image/pom.xml         | 4 ++--
 tests/docker-images/latest-version-image/Dockerfile | 6 ++++--
 tests/docker-images/latest-version-image/pom.xml    | 8 ++++++--
 6 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/docker/pulsar-all/pom.xml b/docker/pulsar-all/pom.xml
index 659153a82e6..f54e95fd885 100644
--- a/docker/pulsar-all/pom.xml
+++ b/docker/pulsar-all/pom.xml
@@ -151,17 +151,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 523a4b1bb3f..f9393ee343d 100644
--- a/docker/pulsar/pom.xml
+++ b/docker/pulsar/pom.xml
@@ -78,7 +78,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>
@@ -86,7 +86,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 576c1b4e422..4af94ee984a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,6 +131,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 053ca3da6e0..1ea3a0cd205 100644
--- a/tests/docker-images/java-test-image/pom.xml
+++ b/tests/docker-images/java-test-image/pom.xml
@@ -151,11 +151,11 @@
                       <name>${docker.organization}/java-test-image</name>
                       <build>
                         <args>
-                          
<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>
                         <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 c23341c0748..0645dd2e78a 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-alpine 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 cd6ca46951f..63ff82a0c2b 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>

Reply via email to