From d14ebd17fea14916e2d47f6b2b7ff6e33bb6084a Mon Sep 17 00:00:00 2001 From: StormyCloudInc Date: Sun, 15 Mar 2026 19:34:50 -0700 Subject: [PATCH] added support for arm v7,arm64(v8) --- .github/workflows/docker.yml | 4 +++- .github/workflows/ghcr.yml | 7 ++++++- Dockerfile | 26 +++++++++++++++++++++----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 627171d0b..da34527b9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,9 +28,11 @@ jobs: uses: docker/build-push-action@v6 with: push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: geti2p/i2p:${{ env.RELEASE_VERSION }} - name: Build and push uses: docker/build-push-action@v6 with: push: true - tags: geti2p/i2p.i2p:${{ env.RELEASE_VERSION }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: geti2p/i2p.i2p:${{ env.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index b9b48fdae..ba43a23c7 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -28,6 +28,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 @@ -50,6 +54,7 @@ jobs: with: context: . push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -60,4 +65,4 @@ jobs: subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true - + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 612e2c190..6114c8956 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ -FROM alpine:latest as builder +ARG TARGETARCH + +# --- Single builder (Java bytecode is platform-independent) --- + +FROM --platform=linux/amd64 alpine:latest AS builder ENV APP_HOME="/i2p" ARG ANT_VERSION="1.10.15" @@ -12,10 +16,22 @@ RUN apk add --no-cache gettext tar bzip2 curl openjdk21 \ && /opt/apache-ant-${ANT_VERSION}/bin/ant preppkg-linux-only \ && rm -rf pkg-temp/osid pkg-temp/lib/wrapper pkg-temp/lib/wrapper.* -FROM alpine:latest -ENV APP_HOME="/i2p" -RUN apk add openjdk21 +# --- Runtime stages per architecture --- +FROM alpine:latest AS runtime-amd64 +RUN apk add --no-cache openjdk21 + +FROM alpine:latest AS runtime-arm64 +RUN apk add --no-cache openjdk21 + +FROM debian:bookworm-slim AS runtime-arm +RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre-headless \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Select runtime based on target architecture +FROM runtime-${TARGETARCH} + +ENV APP_HOME="/i2p" WORKDIR ${APP_HOME} COPY --from=builder /tmp/build/pkg-temp . @@ -37,4 +53,4 @@ LABEL \ org.label-schema.vcs-url="https://github.com/i2p/i2p.i2p" \ org.label-schema.schema-version="1.0" -ENTRYPOINT ["/startapp.sh"] +ENTRYPOINT ["/startapp.sh"] \ No newline at end of file