Refactor Docker setup to support multi-architecture builds and update base image to Alpine

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
Stephen Simpson
2025-03-20 09:04:10 -05:00
parent 7a4f31ec7e
commit a05a8835f4
3 changed files with 34 additions and 7 deletions

View File

@@ -29,12 +29,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
- name: Build and push amd64
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
build-args: |
ARCH=x86_64
tags: |
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:amd64
- name: Build and push arm64
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/arm64
build-args: |
ARCH=aarch64
tags: |
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:arm64
- name: Create and push manifest
run: |
docker manifest create ${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest \
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:amd64 \
${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.GITHUBUSER }}/${{ env.IMAGE_NAME }}:latest