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:
27
.github/workflows/docker-image-linux.yml
vendored
27
.github/workflows/docker-image-linux.yml
vendored
@@ -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
|
||||
Reference in New Issue
Block a user