Skip to content

Commit

Permalink
Add Platform linux/arm64 to Docker Build (#10441)
Browse files Browse the repository at this point in the history
* 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 <git@chris-shaw.dev>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 25, 2024
1 parent cbedd78 commit 4a37203
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}
8 changes: 8 additions & 0 deletions .github/workflows/publish-docker-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,6 +38,7 @@ jobs:
with:
context: .
push: true
platforms: linux/${{ matrix.architecture }}
tags: shieldsio/shields:next
build-args: |
version=${{ env.SHORT_SHA }}
Expand All @@ -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 }}
2 changes: 2 additions & 0 deletions doc/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4a37203

Please sign in to comment.