Skip to content

build(docker): install PHP extensions with PIE instead of pecl - #102

Merged
JohnRDOrazio merged 1 commit into
mainfrom
build/pie-extensions
Oct 10, 2026
Merged

JohnRDOrazio merged 1 commit into
mainfrom
build/pie-extensions

Conversation

@JohnRDOrazio

@JohnRDOrazio JohnRDOrazio commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Description

PECL is deprecated in favour of PIE (PHP Installer for Extensions). This switches the Docker build stage from pecl install to pie install.

It also fixes a real failure mode. When yaml 2.3.0 was freshly published, PECL had no REST dependency metadata for it yet (Package "yaml" Version "2.3.0" does not have REST dependency information available). pecl install apcu yaml then skipped yaml without failing, and the build only broke at the next command, docker-php-ext-enable yaml (error: 'yaml' does not exist). That is what broke the E2E image build on Liturgical-Calendar/LiturgicalCalendarFrontend#601. PIE fails at the install itself.

Changes

  • PIE is copied in from its pinned binary image: COPY --from=ghcr.io/php/pie:1.5.2-bin /pie /usr/bin/pie
  • pie install pecl/yaml:^2.3 and pie install apcu/apcu:^5.1 replace pecl install apcu yaml
  • PIE enables the extensions itself: it writes the same conf.d/docker-php-ext-*.ini files that docker-php-ext-enable does. They are therefore dropped from docker-php-ext-enable, and the final stage's existing COPY --from=build of extensions/ and conf.d/ carries them over unchanged.
  • unzip is added to the build stage's apt packages. PIE fetches the extension source through Composer and fails without unzip or the zip extension.

PIE downloads the source from GitHub (api.github.com zipball, redirected to codeload) without a token, which is the same host the Dockerfile's composer install already uses. So no token plumbing is added.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Built the image locally to the final stage with docker build.
  • In the final image, php -m lists the expected extensions and phpversion() reports yaml 2.3.0 and apcu 5.1.28. yaml_emit() runs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the application’s build and packaging setup, including how certain components are installed and enabled.
    • This change is limited to the build process. No changes to user-facing features or application behavior are included.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05352572-f04d-433e-9893-372a09d7665e

📥 Commits

Reviewing files that changed from the base of the PR and between e3d607b and f87a0d1.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11456d22-3951-47e9-81b4-099a1577cf01


📥 Commits

Reviewing files that changed from the base of the PR and between b063f7d and e3d607b.



📒 Files selected for processing (1)
  • Dockerfile


Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.




Walkthrough

The Docker build adds PIE 1.5.2 and uses it to install YAML and APCu with version constraints. It also adds unzip and removes YAML and APCu from the extension-enable command.

Changes

PHP Extension Installation

Layer / File(s) Summary
PIE-based extension installation
Dockerfile
The build adds PIE 1.5.2 and unzip. PIE installs YAML with ^2.3 and APCu with ^5.1. The extension-enable list retains intl, zip, calendar, and gettext.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e3d60

The Dockerfile preserves the extension installation and transfer path into the final image. No actionable merge-blocking issue is established, though the reported final-image checks were not independently reproduced.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: replacing PECL with PIE to install PHP extensions in the Docker build.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.



✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit watched the build take shape,
As PIE brought YAML to the gate.
APCu joined, with versions set,
And unzip helped the tools connect.
Then off I hopped, pleased by the crate!

Comment @coderabbitai help to get the list of available commands.

PECL is deprecated in favour of PIE (PHP Installer for Extensions). It also
failed silently: when the freshly published yaml 2.3.0 had no REST dependency
metadata yet, `pecl install apcu yaml` skipped yaml without failing and the
build only broke later, at `docker-php-ext-enable yaml`.

PIE (pinned to 1.5.2 via its ghcr.io binary image) installs pecl/yaml and
apcu/apcu from Packagist and enables them itself, so they are dropped from
docker-php-ext-enable.
unzip is added to the build stage because PIE needs it to extract sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnRDOrazio
JohnRDOrazio merged commit 957ee1f into main Oct 10, 2026
5 checks passed
@JohnRDOrazio
JohnRDOrazio deleted the build/pie-extensions branch October 10, 2026 18:50
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.

1 participant