diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ca8af91..8c6e588 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -12,8 +12,6 @@ on: pull_request: branches: [ 'main' ] workflow_dispatch: - branches: [ '*' ] - tags: [ 'v*.*.*' ] env: REGISTRY: ghcr.io @@ -24,21 +22,14 @@ env: jobs: build: + # Iterates through each OS using a matrix strategy + # See https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs strategy: - fail-fast: true + fail-fast: false # setting false to work out u26 builds. matrix: os: [ 'ol8', 'el9', 'el10', 'u20', 'u22', 'u24', 'u26' ] - arch: [ 'amd64', 'arm64' ] - include: - # Intel Runner: Compiles native x86 AND safely triggers emulated tasks for supported OS versions - - arch: amd64 - runner: ubuntu-latest - platforms: linux/amd64 - - arch: arm64 - runner: ubuntu-24.04-arm - platforms: linux/arm64 - runs-on: ${{ matrix.runner }} + runs-on: ubuntu-latest permissions: contents: read packages: write @@ -51,19 +42,13 @@ jobs: uses: actions/checkout@v6 - name: Set up QEMU - if: matrix.arch == 'amd64' uses: docker/setup-qemu-action@v4 - - name: Setup Docker buildx uses: docker/setup-buildx-action@v4 with: - # Automatically preserves your default execution privileges while passing parameters - buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host - # Tells QEMU/BuildKit to cleanly map 64-bit kernel filesystem structures down to a 32-bit layout - buildkitd-config-inline: | - [worker.containerd] - prefer32 = true - + # This forces BuildKit to drop the 64-bit structural extensions + # when extracting layers, bypassing the 32-bit emulation crash entirely. + buildkitd-flags: --oci-worker-snapshotter=overlayfs # Login against a Docker registry except on PR # https://github.com/docker/login-action @@ -93,24 +78,32 @@ jobs: # # Platform Builds # - - name: Build and push images + + # amd64 and arm64 -- OL, EL, Debian and Ubuntu + + - name: Build and push amd64 and arm64 id: build-and-push + # No condition here; build everything on these platforms. uses: docker/build-push-action@v7 with: context: . file: ./docker-envs/Dockerfile-${{ matrix.os }} - # Dynamically builds whatever platforms are defined for this specific runner/OS match - platforms: >- - ${{ matrix.arch == 'arm64' && 'linux/arm64' || '' }}${{ - (matrix.arch == 'amd64' && (matrix.os == 'u20' || matrix.os == 'u22' || matrix.os == 'u24')) - && 'linux/amd64,linux/arm/v7,linux/ppc64le' - || '' - }}${{ - (matrix.arch == 'amd64' && (matrix.os == 'ol8' || matrix.os == 'el9' || matrix.os == 'el10' || matrix.os == 'u26')) - && 'linux/amd64' - || '' - }} + platforms: linux/amd64, linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + # armv7 and ppc64le - Debian and Ubuntu + + - name: Build and push armv7 and ppc64le + id: build-and-push-multiarch + if: ${{ startsWith(matrix.os, 'd') || startsWith(matrix.os, 'u') }} + uses: docker/build-push-action@v7 + with: + context: . + file: ./docker-envs/Dockerfile-${{ matrix.os }} + # These platforms fail: linux/arm/v7, linux/ppc64le + platforms: linux/arm/v7, linux/ppc64le + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}