From 84eef620131ac6dcc17a61aa2f0a64fa2ee0fe04 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Fri, 13 Nov 2026 17:58:55 -0300 Subject: [PATCH 1/3] Refresh PHPQA parents and test architecture-correct checker binaries --- .github/workflows/ci-cd.yml | 64 +++++++++++++++++++++++++---------- 7.4/Dockerfile | 4 ++- 8.0/Dockerfile | 4 ++- 8.1/Dockerfile | 4 ++- 8.2/Dockerfile | 4 ++- 8.3/Dockerfile | 4 ++- template/Dockerfile.blade.php | 4 ++- 7 files changed, 65 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 9033ff8..1ad945c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,6 +1,17 @@ name: CI/CD -on: [push, workflow_dispatch] +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + repository_dispatch: + types: [docker-php-updated] + schedule: + - cron: '43 6 * * 1' + +permissions: + contents: read env: DOCKER_BUILDKIT: 1 @@ -8,32 +19,25 @@ env: jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} strategy: + fail-fast: false matrix: version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + runner: [ubuntu-latest, ubuntu-24.04-arm] steps: - name: Checkout code - uses: actions/checkout@v3.1.0 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: actions/checkout@v4 - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa' - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + uses: docker/setup-buildx-action@v3 - name: Build and export to Docker - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: ${{ matrix.version }} + pull: true load: true tags: kooldev/phpqa:${{ matrix.version }} @@ -46,12 +50,38 @@ jobs: docker run kooldev/phpqa:${{ matrix.version }} phpcpd --version docker run kooldev/phpqa:${{ matrix.version }} php-cs-fixer --version docker run kooldev/phpqa:${{ matrix.version }} local-php-security-checker -help + docker run kooldev/phpqa:${{ matrix.version }} phpstan --version + docker run kooldev/phpqa:${{ matrix.version }} phpcs --version + + publish: + needs: build + if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa' + runs-on: ubuntu-latest + strategy: + matrix: + version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push - uses: docker/build-push-action@v3 - if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa' + uses: docker/build-push-action@v6 with: context: ${{ matrix.version }} + pull: true platforms: linux/amd64,linux/arm64 push: true tags: kooldev/phpqa:${{ matrix.version }} diff --git a/7.4/Dockerfile b/7.4/Dockerfile index 65092de..e835e29 100644 --- a/7.4/Dockerfile +++ b/7.4/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 54ab9d9..7fb1dd7 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 0bc9dc5..5648e11 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 55baf2d..2f0511c 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index a6ca2ec..2a33f86 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ diff --git a/template/Dockerfile.blade.php b/template/Dockerfile.blade.php index 3f30e17..eb10a8c 100644 --- a/template/Dockerfile.blade.php +++ b/template/Dockerfile.blade.php @@ -12,6 +12,7 @@ && rm -rf /var/cache/apk/* /tmp/* # install QA tools +ARG TARGETARCH RUN \ # install and set up QA tools from Composer composer global require squizlabs/php_codesniffer \ @@ -21,7 +22,8 @@ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ + && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ && chmod +x /phars/* \ From 739ef0878fd47edae6cbc56eced1f6f51757ec84 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Fri, 13 Nov 2026 18:39:00 -0300 Subject: [PATCH 2/3] Use PHP parent dispatch instead of a redundant rebuild schedule --- .github/workflows/ci-cd.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 1ad945c..8517602 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -7,8 +7,6 @@ on: workflow_dispatch: repository_dispatch: types: [docker-php-updated] - schedule: - - cron: '43 6 * * 1' permissions: contents: read From 5dfd1ef4273a72ee3745cbf8422960f8b079ea58 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Sat, 14 Nov 2026 10:50:33 -0300 Subject: [PATCH 3/3] refactor: remove redundant architecture case from generated images --- 7.4/Dockerfile | 1 - 8.0/Dockerfile | 1 - 8.1/Dockerfile | 1 - 8.2/Dockerfile | 1 - 8.3/Dockerfile | 1 - template/Dockerfile.blade.php | 1 - 6 files changed, 6 deletions(-) diff --git a/7.4/Dockerfile b/7.4/Dockerfile index e835e29..de122ef 100644 --- a/7.4/Dockerfile +++ b/7.4/Dockerfile @@ -22,7 +22,6 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 7fb1dd7..9faad54 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -22,7 +22,6 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 5648e11..ade0691 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -22,7 +22,6 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 2f0511c..0cf0e08 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -22,7 +22,6 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 2a33f86..b96c038 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -22,7 +22,6 @@ RUN \ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ diff --git a/template/Dockerfile.blade.php b/template/Dockerfile.blade.php index eb10a8c..5ffee00 100644 --- a/template/Dockerfile.blade.php +++ b/template/Dockerfile.blade.php @@ -22,7 +22,6 @@ # download PHAR and make them executable && mkdir /phars \ && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ - && case "$TARGETARCH" in amd64|arm64) ;; *) echo "Unsupported architecture: $TARGETARCH" >&2; exit 1 ;; esac \ && curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \ && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \