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

slfan1989 pushed a commit to branch docker-hadoop-3.4.2-lean
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/docker-hadoop-3.4.2-lean by 
this push:
     new 486bda14883 HADOOP-19723. Build multi-arch hadoop image (#8023) 
Contributed by Doroszlai Attila
486bda14883 is described below

commit 486bda148839b4ec49fb5c4ca7676d6af94d72f6
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Fri Oct 10 04:18:04 2025 +0200

    HADOOP-19723. Build multi-arch hadoop image (#8023) Contributed by 
Doroszlai Attila
    
    * HADOOP-19723. Build multi-arch hadoop image
    
    Signed-off-by: Shilun Fan <[email protected]>
---
 .github/workflows/build-hadoop-image.yaml |  8 +++++++-
 Dockerfile                                | 20 +++++++++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build-hadoop-image.yaml 
b/.github/workflows/build-hadoop-image.yaml
index 44790c6d195..e193d649d9d 100644
--- a/.github/workflows/build-hadoop-image.yaml
+++ b/.github/workflows/build-hadoop-image.yaml
@@ -48,6 +48,12 @@ jobs:
           flavor: |
             latest=false
 
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
+
+      - name: Set up Docker Buildx
+        uses: 
docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
+
       - name: Login to ghcr.io
         id: login
         if: ${{ github.event_name != 'pull_request' }}
@@ -61,7 +67,7 @@ jobs:
         id: build
         uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
         with:
-          platforms: linux/amd64
+          platforms: linux/amd64,linux/arm64
           push: ${{ github.event_name != 'pull_request' }}
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
diff --git a/Dockerfile b/Dockerfile
index bd1e3c279cf..12910632777 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,11 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM apache/hadoop-runner
-ARG 
HADOOP_URL=https://dlcdn.apache.org/hadoop/common/hadoop-3.4.2/hadoop-3.4.2-lean.tar.gz
-WORKDIR /opt
-RUN sudo rm -rf /opt/hadoop && curl -LSs -o hadoop.tar.gz $HADOOP_URL && tar 
zxf hadoop.tar.gz && rm hadoop.tar.gz && mv hadoop* hadoop && rm -rf 
/opt/hadoop/share/doc
+FROM ghcr.io/apache/hadoop-runner:jdk11-u2204
+ARG HADOOP_VERSION=3.4.2
+ARG HADOOP_FLAVOR=-lean
+ARG BASE_URL=https://dlcdn.apache.org/hadoop/common
+ARG TARGETPLATFORM
 WORKDIR /opt/hadoop
+RUN set -eux; \
+    echo "Building for ${TARGETPLATFORM}"; \
+    case "${TARGETPLATFORM}" in \
+        linux/amd64) HADOOP_ARCH='' ;; \
+        linux/arm64) HADOOP_ARCH='-aarch64' ;; \
+        *) echo "Unsupported platform: ${TARGETPLATFORM}"; exit 1 ;; \
+    esac; \
+    export 
HADOOP_URL="${BASE_URL}/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}${HADOOP_ARCH}${HADOOP_FLAVOR}.tar.gz";
 \
+    curl -LSs "$HADOOP_URL" | tar -x -z --strip-components 1 && rm -rf 
/opt/hadoop/share/doc
 ADD log4j.properties /opt/hadoop/etc/hadoop/log4j.properties
 RUN sudo chown -R hadoop:users /opt/hadoop/etc/hadoop/*
-ENV HADOOP_CONF_DIR /opt/hadoop/etc/hadoop
+ENV HADOOP_CONF_DIR=/opt/hadoop/etc/hadoop


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to