diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index a786e29..486f99d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -134,7 +134,8 @@ jobs: tag: ($ver + (if (.suffix // "") == "" then "" else "-" + .suffix end)), context: $ctx, target: .target, - build_args: ((.args // {}) | to_entries | map(.key + "=" + (.value | tostring)) | join("\n")) + build_args: ((.args // {}) | to_entries | map(.key + "=" + (.value | tostring)) | join("\n")), + platforms: (.platforms // "linux/amd64") } ' <<< "$entries") done @@ -158,6 +159,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -173,7 +177,7 @@ jobs: context: ./${{ matrix.build.context }} target: ${{ matrix.build.target }} build-args: ${{ matrix.build.build_args }} - platforms: linux/amd64 + platforms: ${{ matrix.build.platforms }} push: true tags: devitools/${{ matrix.build.image }}:${{ matrix.build.tag }} cache-from: type=gha,scope=${{ matrix.build.image }}-${{ matrix.build.tag }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2e11c82..160b905 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -74,6 +74,18 @@ jobs: errors=$((errors+1)) fi + bad_platforms=$(jq -c '[.[] | select( + has("platforms") and ( + (.platforms | type) != "string" or + (.platforms | length) == 0 + ) + )]' <<< "$entries") + if [ "$(jq 'length' <<< "$bad_platforms")" != "0" ]; then + echo "::error file=${manifest}::'platforms' must be a non-empty string when present (e.g. 'linux/amd64' or 'linux/amd64,linux/arm64'):" + jq -r '.[] | " - " + (. | tostring)' <<< "$bad_platforms" + errors=$((errors+1)) + fi + if [ ! -f "$dockerfile" ]; then echo "::error file=${manifest}::sibling Dockerfile not found at ${dockerfile}" errors=$((errors+1)) diff --git a/php-hyperf/8.3/variants.yaml b/php-hyperf/8.3/variants.yaml index 1f541b3..4486bb1 100644 --- a/php-hyperf/8.3/variants.yaml +++ b/php-hyperf/8.3/variants.yaml @@ -4,6 +4,11 @@ target: hyperf args: APP_TARGET: dev +- suffix: arm-dev + target: hyperf + args: + APP_TARGET: dev + platforms: linux/arm64 - suffix: otel target: hyperf-otel args: