Skip to content

Commit

Permalink
feat: configure docker buildx for multi platform docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed May 13, 2024
1 parent 4d7f421 commit 3768a53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,10 @@ jobs:
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.7.1'

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64

uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
Expand All @@ -57,13 +52,13 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_REPOSITORY }}:latest
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
platforms: linux/amd64, linux/arm64, linux/arm64/v8, linux/arm/v7
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM busybox
FROM --platform=$BUILDPLATFORM busybox

RUN mkdir -p /app
RUN chmod 777 /app
Expand Down

0 comments on commit 3768a53

Please sign in to comment.