From 4a37203da76aa141be52e9157fc3d942bc560eae Mon Sep 17 00:00:00 2001 From: SmAsHeD <6071159+smashedr@users.noreply.github.com> Date: Sun, 25 Aug 2024 12:16:22 -0700 Subject: [PATCH] Add Platform linux/arm64 to Docker Build (#10441) * Add linux/arm64 Platform to Docker Build * Update Next Workflow * add a note to the docs about linux/arm64 * Update Build Jobs * push both architectures to GHCR * only push linux/arm64 for snapshots, not next tag * Use Matrix Build * revert docs changes --------- Co-authored-by: chris48s Co-authored-by: chris48s --- .github/workflows/create-release.yml | 7 +++++++ .github/workflows/publish-docker-next.yml | 8 ++++++++ doc/self-hosting.md | 2 ++ 3 files changed, 17 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 88bae303e41ca..1335744525ee1 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -17,6 +17,9 @@ jobs: contains(github.event.pull_request.labels.*.name, 'release') runs-on: ubuntu-latest + strategy: + matrix: + architecture: [amd64, arm64] steps: - name: Get current date @@ -36,6 +39,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + platforms: linux/${{ matrix.architecture }} - name: Login to DockerHub uses: docker/login-action@v3 @@ -48,6 +53,7 @@ jobs: with: context: . push: true + platforms: linux/${{ matrix.architecture }} tags: shieldsio/shields:server-${{ steps.date.outputs.date }} build-args: | version=server-${{ steps.date.outputs.date }} @@ -64,6 +70,7 @@ jobs: with: context: . push: true + platforms: linux/${{ matrix.architecture }} tags: ghcr.io/badges/shields:server-${{ steps.date.outputs.date }} build-args: | version=server-${{ steps.date.outputs.date }} diff --git a/.github/workflows/publish-docker-next.yml b/.github/workflows/publish-docker-next.yml index 7ea37682eac98..59136a1aff3b4 100644 --- a/.github/workflows/publish-docker-next.yml +++ b/.github/workflows/publish-docker-next.yml @@ -10,12 +10,18 @@ permissions: jobs: publish-docker-next: runs-on: ubuntu-latest + strategy: + matrix: + architecture: [amd64, arm64] + steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + platforms: linux/${{ matrix.architecture }} - name: Login to DockerHub uses: docker/login-action@v3 @@ -32,6 +38,7 @@ jobs: with: context: . push: true + platforms: linux/${{ matrix.architecture }} tags: shieldsio/shields:next build-args: | version=${{ env.SHORT_SHA }} @@ -51,6 +58,7 @@ jobs: with: context: . push: true + platforms: linux/${{ matrix.architecture }} tags: ghcr.io/badges/shields:next build-args: | version=${{ env.SHORT_SHA }} diff --git a/doc/self-hosting.md b/doc/self-hosting.md index 7c875740e07f0..46bdc59da6328 100644 --- a/doc/self-hosting.md +++ b/doc/self-hosting.md @@ -95,6 +95,8 @@ $ docker pull ghcr.io/badges/shields:next $ docker pull ghcr.io/badges/shields:next ``` +We push both linux/amd64 and linux/arm64 images. We use the linux/amd64 image ourselves to host shields.io. We push a linux/arm64 image, but we don't consume it ourselves and it receives no testing beyond ensuring the docker image builds without error. + ### Building Docker Image Locally Alternatively, you can build and run the server locally using Docker. First build an image: