Skip to content

Commit

Permalink
multi-arch docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnaud committed Mar 31, 2024
1 parent 3f9c7e5 commit 4b3e038
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Log in to registry
# This is where you will update the PAT to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Push image
- name: Build and Push container image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
Expand All @@ -46,5 +50,6 @@ jobs:
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker buildx build --file Dockerfile --label "runnumber=${GITHUB_RUN_ID}" --push \
--tag $IMAGE_ID:$VERSION \
--platform linux/amd64,linux/arm64,linux/armv7 .

0 comments on commit 4b3e038

Please sign in to comment.