Skip to content

fix rhel dockerfile #13

fix rhel dockerfile

fix rhel dockerfile #13

Workflow file for this run

name: Build builder images
on:
push:
branches: [master]
paths:
- Dockerfile.debian
- Dockerfile.alpine
- Dockerfile.rhel
- .github/workflows/build-images.yml
workflow_dispatch:
permissions: {}
env:
REGISTRY: ghcr.io
OWNER: static-php
jobs:
build:
name: Build (${{ matrix.image.name }} ${{ matrix.platform.arch }})
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image:
- dockerfile: Dockerfile.debian
name: packages-builder-debian
build-args: ""
- dockerfile: Dockerfile.alpine
name: packages-builder-alpine
build-args: ""
- dockerfile: Dockerfile.rhel
name: packages-builder-rhel-8
build-args: "ALMA_VERSION=8"
- dockerfile: Dockerfile.rhel
name: packages-builder-rhel-9
build-args: "ALMA_VERSION=9"
- dockerfile: Dockerfile.rhel
name: packages-builder-rhel-10
build-args: "ALMA_VERSION=10"
platform:
- arch: amd64
runs-on: ubuntu-24.04
- arch: arm64
runs-on: ubuntu-24.04-arm
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
- name: Log in to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
with:
context: .
file: ${{ matrix.image.dockerfile }}
platforms: linux/${{ matrix.platform.arch }}
build-args: ${{ matrix.image.build-args }}
cache-from: type=gha,scope=${{ matrix.image.name }}-${{ matrix.platform.arch }}
cache-to: type=gha,scope=${{ matrix.image.name }}-${{ matrix.platform.arch }},mode=max
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image.name }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: digests-${{ matrix.image.name }}-${{ matrix.platform.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
name: Merge manifest (${{ matrix.image }})
runs-on: ubuntu-24.04
needs: build
permissions:
packages: write
strategy:
fail-fast: false
matrix:
image:
- packages-builder-debian
- packages-builder-alpine
- packages-builder-rhel-8
- packages-builder-rhel-9
- packages-builder-rhel-10
steps:
- name: Download digests
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: digests-${{ matrix.image }}-*
path: /tmp/digests
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
- name: Log in to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
-t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }}:latest \
-t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }}:${{ github.sha }} \
$(printf '${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }}@sha256:%s ' *)
- name: Inspect manifest
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ matrix.image }}:${{ github.sha }}