Skip to content

Make arm64 and amd64 docker images #1

Make arm64 and amd64 docker images

Make arm64 and amd64 docker images #1

Workflow file for this run

name: Make arm64 and amd64 docker images
on:
workflow_dispatch:
env:
registry: ghcr.io
image: coredns-nomad
version: v1.11.1
jobs:
build-images:
strategy:
matrix:
platform: [ linux ]
arch: [ arm64, amd64 ]
uses: mutablelogic/go-coredns-nomad/.github/workflows/build-image.yaml@main
with:
registry: ghcr.io
image: coredns-nomad
version: v1.11.1
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}
create-manifest:
needs:
- build-images
runs-on: ubuntu-latest
steps:
- name: Set tags
id: tags
run: |
echo "manifest=${{ env.registry }}/${{ github.repository_owner }}/${{ env.image }}" >> $GITHUB_OUTPUT
echo "tag=${{ env.version }}" >> $GITHUB_OUTPUT
- name: Login
uses: docker/login-action@v3
with:
registry: ${{ env.registry}}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create Manifest
run: |
docker manifest create ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \
--amend ${{ steps.tags.outputs.manifest }}-linux-arm64:${{ steps.tags.outputs.tag }} \
--amend ${{ steps.tags.outputs.manifest }}-linux-amd64:${{ steps.tags.outputs.tag }}
docker manifest annotate --arch arm64 ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \
${{ steps.tags.outputs.manifest }}-linux-arm64:${{ steps.tags.outputs.tag }}
docker manifest annotate --arch amd64 ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \
${{ steps.tags.outputs.manifest }}-linux-amd64:${{ steps.tags.outputs.tag }}
docker manifest push ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }}