From 9f440217fc6e445b4f42e0a59fe55d1f4fbaff29 Mon Sep 17 00:00:00 2001 From: nicolasotmani Date: Wed, 21 Oct 2026 17:11:33 +0200 Subject: [PATCH] chore(php): run php-cs-fixer image on PHP 8.2 Alpine Keep Fixer 3.13.0 rules; set PHP_CS_FIXER_IGNORE_ENV until a Fixer >=3.15 bump. Co-authored-by: Cursor --- Dockerfile | 4 +++- README.md | 6 ++++++ entrypoint.sh | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f343dd0..64c2737 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM php:8.1.34-alpine +# Pin 8.2.35 once Docker Hub publishes php:8.2.35-cli-alpine (CVE-2026-109618/109619). +# Official library CI already built 8.2.35 (docker-library/php run 39615869747); Hub lag. +FROM php:8.2-alpine ARG PHP_CS_FIXER_VERSION=3.13.0 ARG PHP_CS_FIXER_SHA256=ac2e57e32cdae67f21baa88f78405f93d4d6e928f41ba62dc91505565c785a44 diff --git a/README.md b/README.md index 7505db2..5a83e1c 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ docker run --rm -v "$PWD:/app" -w /app ghcr.io/mobsuccess-devops/github-actions- ## Image +Base runtime: PHP 8.2 Alpine (`php:8.2-alpine`; pin `php:8.2.35-cli-alpine` +when Docker Hub publishes the CVE-patched tag). PHP-CS-Fixer stays at +**3.13.0** (same rules as today); `PHP_CS_FIXER_IGNORE_ENV=1` is set in the +entrypoint so 3.13.0 can run on PHP 8.2. Bumping Fixer to ≥3.15.0 (official +8.2 support) is a separate change — it can reformat consumer repos. + A push to `master` that changes the `Dockerfile` or `entrypoint.sh` publishes the image to `ghcr.io/mobsuccess-devops/github-actions-php-cs-fixer` (`.github/workflows/docker.yml`), tagged with the PHP-CS-Fixer version. The diff --git a/entrypoint.sh b/entrypoint.sh index 169eb74..5dc9edc 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,5 +2,10 @@ set -e +# PHP-CS-Fixer 3.13.0 declares max PHP 8.1.*; we run on 8.2 for parity with +# app images. Official 8.2 support starts at Fixer 3.15.0 (ruleset bump — do +# separately). Until then, allow the runtime so dry-run CI can execute. +export PHP_CS_FIXER_IGNORE_ENV=1 + /usr/local/bin/php-cs-fixer --version /usr/local/bin/php-cs-fixer fix $*