Skip to content

chore(docker): rebuild PHP-CS-Fixer on alpine PHP packages [FTTECH-15121] - #10

Closed
nicolasotmani wants to merge 4 commits into
masterfrom
chore/build-action-from-dockerfile
Closed

nicolasotmani wants to merge 4 commits into
masterfrom
chore/build-action-from-dockerfile

Conversation

@nicolasotmani

@nicolasotmani nicolasotmani commented Sep 30, 2026 •

Copy link
Copy Markdown

What Does It Do?

Rebuilds the PHP-CS-Fixer image on alpine:3.19 with Alpine PHP 8.2 packages (CLI only) and the same php-cs-fixer v3.13.0 phar, instead of the fuller php:8.1-alpine base. Adds upgrade-aws.yml so a push to master republishes public.ecr.aws/u9q7y3l4/github-actions-php-cs-fixer:v3.13.0. Points action.yml at that ECR image (consumers already use it).

Context

Same class of failure as kuberneteslint#40 / FTTECH-15116: intermittent toomanyrequests: Data limit exceeded when GitHub runners pull anonymously from ECR Public.

Unlike kuberneteslint (359 MB → 70 MB), this image was already alpine-based (~32 MB). The change still follows the same pattern: slim the published image and overwrite the existing ECR tag, so every repository on docker://public.ecr.aws/u9q7y3l4/github-actions-php-cs-fixer:v3.13.0 picks it up at the next CI run with no consumer PR.

Test plan

  • docker compose build succeeds for linux/amd64
  • php-cs-fixer --version reports 3.13.0 in the built image
  • Run like GitHub Actions (-w /github/workspace, workspace mounted) against a known-good and a known-bad PHP file
  • After merge: ECR workflow pushes v3.13.0, and a consumer PHP-CS-Fixer job pulls the new image without changing its workflow

Anonymous pulls of the public ECR image hit Data limit exceeded on shared GitHub runner IPs. Point the action at its Dockerfile so CI builds locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 30, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Match the kuberneteslint approach: slim the published ECR image and push it
via upgrade-aws.yml so consumers keep docker://...:v3.13.0 unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nicolasotmani nicolasotmani changed the title chore(action): build image on runner to avoid ECR Public limits [FTTECH-15121] chore(docker): rebuild PHP-CS-Fixer on alpine PHP packages [FTTECH-15121] Sep 30, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/upgrade-aws.yml Outdated
Comment on lines +63 to +66
- name: Build
run: docker-compose build --build-arg BUILDKIT_INLINE_CACHE=1
- name: Push
run: docker-compose push

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'avais oublié de modifier ça sur ma PR ;)

Suggested change
- name: Build
run: docker-compose build --build-arg BUILDKIT_INLINE_CACHE=1
- name: Push
run: docker-compose push
- name: Build
run: docker compose build --build-arg BUILDKIT_INLINE_CACHE=1
- name: Push
run: docker compose push

⚠️ Le rôle AWS GHA,github-actions-php-cs-fixer doit exister pour que le workflow puisse pousser. Ce n'est pas le cas actuellement.

Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: switched to docker compose.

For the IAM role: noted — GHA,github-actions-php-cs-fixer still needs to be created before this workflow can push. Happy to follow whatever process you used for github-actions-kuberneteslint / github-actions-black if you point me at it.

Comment thread Dockerfile Outdated
Comment on lines +8 to +9
# Match mobsuccess: PHP 8.1.34 + php-cs-fixer 3.13.0. Use the cli-alpine
# variant (not the fuller php:8.1-alpine default) to keep the ECR image small.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php:8.1-alpine et php:8.1.34-cli-alpine sont la même image, Claude a comparé leurs empreintes sur Docker Hub, elles sont identiques aujourd'hui.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — same digest today. Kept the 8.1.34-cli-alpine pin to match mobsuccess’s PHP version explicitly, and dropped the claim that this is a size win versus php:8.1-alpine.

Address review: docker compose v2 CLI, and note that php:8.1.34-cli-alpine
matches php:8.1-alpine's digest today so this is a version pin, not a size win.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants