Skip to content

Use flexible PHP version in Docker builds#522

Closed
achton wants to merge 2 commits intov1.xfrom
claude/review-pr-521-B8fq1
Closed

Use flexible PHP version in Docker builds#522
achton wants to merge 2 commits intov1.xfrom
claude/review-pr-521-B8fq1

Conversation

@achton
Copy link
Member

@achton achton commented Jan 28, 2026

Summary

  • Use build args for PHP and Composer versions, allowing version flexibility without changing the Dockerfile
  • Copy Composer binary from official image into PHP base image, ensuring the PHP version used for dependency installation matches the runtime version
  • Add PHP version matrix to Docker build CI workflow, testing builds with all PHP versions supported by the project (currently 8.3, 8.4)

Motivation

PR #521 (Dependabot Composer update to 2.9.4) fails because the composer:2.9.4 image ships with PHP 8.5.2, which exceeds the project's PHP version constraint (>=8.3 <8.5). By decoupling the Composer binary from its base PHP image, we can update Composer independently of PHP version changes.

Also, the Composer people discourage relying on the PHP version in their container image:

"You should not rely on the PHP version in our container... We do not provide a Composer image for each supported PHP version."

Test plan

- Switch from Docker Hub to AWS ECR Public Gallery for base images
  to avoid rate limiting issues (addresses #268)
- Use build args for PHP and Composer versions, allowing version
  flexibility without changing the Dockerfile
- Copy Composer binary from official image into PHP base image,
  ensuring the PHP version used for dependency installation matches
  the runtime version
- Add PHP version matrix to Docker build CI workflow, testing builds
  with all PHP versions supported by the project (currently 8.3, 8.4)

This change enables Dependabot Composer updates to work correctly
by decoupling the Composer version from the PHP version used in builds.

https://claude.ai/code/session_01UkUqTPwnnc56NFoFqo52Lv
Keep using standard Docker Hub image references rather than
switching to AWS ECR Public Gallery.

https://claude.ai/code/session_01UkUqTPwnnc56NFoFqo52Lv
@achton achton requested a review from a team as a code owner January 28, 2026 08:08
@achton achton closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants