🐳 Install PHP 8.4 + 8.5 with common extensions#9
Conversation
WalkthroughDockerfile pins the runner base image to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (5)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
DockerfileREADME.md
🔇 Additional comments (3)
README.md (1)
28-28: LGTM!The Composer documentation accurately reflects the installation in the Dockerfile.
Dockerfile (2)
47-92: LGTM!The common extensions (mysqli, pdo-mysql, opcache) are consistently added across all PHP versions. This provides a solid foundation for most PHP applications.
93-106: LGTM!PHP 8.4 installation with consistent extensions across all versions.
f51e63a to
bf64920
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Dockerfile (1)
51-64: Minor: Consider reordering extensions for consistency.The extension list for PHP 8.1 has
php8.1-opcachebeforephp8.1-intl(lines 63-64), while PHP 8.2, 8.3, and 8.4 haveintlbeforeopcache. Although this doesn't affect functionality, maintaining consistent ordering improves maintainability.🔎 Proposed fix for consistent ordering
php8.1-zip \ php8.1-bcmath \ - php8.1-opcache \ php8.1-intl \ + php8.1-opcache \
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
DockerfileREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build Check
🔇 Additional comments (3)
Dockerfile (3)
110-115: Previous issue resolved: PHP 8.1 now registered.The previous review comment about PHP 8.1 not being registered with
update-alternativeshas been addressed. All PHP versions (8.1–8.4) are now properly registered with appropriate priority values, and PHP 8.4 is correctly set as the default.
117-121: Previous issue resolved: Composer installation corrected.The previous review comment about the invalid
--version=latestflag has been addressed. The Composer installation now correctly omits the version flag, allowing the installer to default to the latest stable release as intended.
93-106: PHP 8.4 is available in the ondrej/php PPA.PHP 8.4 and all specified extensions (curl, gd, mbstring, mysqli, pdo-mysql, xml, zip, bcmath, intl, opcache) are available in the
ppa:ondrej/phprepository. Multiple builds are supported for Jammy, Noble, and various architectures including amd64 and arm64.
bf64920 to
765af66
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
DockerfileREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🔇 Additional comments (2)
Dockerfile (2)
132-136: LGTM! Composer installation is correct.The Composer installation follows best practices:
- Uses the official installer
- Omits
--versionto install the latest stable release by default- Sets proper permissions
The previous issue regarding
--version=latesthas been successfully addressed ✅
107-120: The concern about PHP 8.5 availability and PR scope is no longer applicable.PHP 8.5 reached general availability on November 20, 2025, and the git commit history confirms both PHP 8.4 and 8.5 were intentionally included in this PR ("Install PHP 8.4 + 8.5 with common extensions"). With PHP 8.5.1 now released (December 18, 2025) and active security support through 2029, the original concern about stability is outdated.
Likely an incorrect or invalid review comment.
765af66 to
1164cfa
Compare
1164cfa to
c43601e
Compare
a651915 to
4eceeda
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Dockerfile (1)
52-131: Consider consolidating PHP installation RUN commands.The five separate RUN commands for PHP installations create multiple Docker layers and, except for PHP 8.5, don't clean up apt caches. Consolidating them would reduce image size and simplify maintenance.
🔎 Proposed consolidation
# Add PHP repository and install PHP 8.1, 8.2, 8.3, 8.4, 8.5 and common extensions RUN add-apt-repository -y ppa:ondrej/php \ - && apt-get update - -# PHP 8.1 with common extensions -RUN apt-get install -y --no-install-recommends \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + # PHP 8.1 with common extensions php8.1 \ php8.1-cli \ php8.1-common \ php8.1-curl \ php8.1-gd \ php8.1-mbstring \ php8.1-mysqli \ php8.1-pdo-mysql \ php8.1-xml \ php8.1-zip \ php8.1-bcmath \ php8.1-opcache \ - php8.1-intl - - # PHP 8.2 with common extensions -RUN apt-get install -y --no-install-recommends \ + php8.1-intl \ + # PHP 8.2 with common extensions php8.2 \ php8.2-cli \ php8.2-common \ php8.2-curl \ php8.2-gd \ php8.2-mbstring \ php8.2-mysqli \ php8.2-pdo-mysql \ php8.2-xml \ php8.2-zip \ php8.2-bcmath \ php8.2-intl \ - php8.2-opcache - -# PHP 8.3 with common extensions -RUN apt-get install -y --no-install-recommends \ + php8.2-opcache \ + # PHP 8.3 with common extensions php8.3 \ php8.3-cli \ php8.3-common \ php8.3-curl \ php8.3-gd \ php8.3-mbstring \ php8.3-mysqli \ php8.3-pdo-mysql \ php8.3-xml \ php8.3-zip \ php8.3-bcmath \ php8.3-intl \ - php8.3-opcache - -# PHP 8.4 with common extensions -RUN apt-get install -y --no-install-recommends \ + php8.3-opcache \ + # PHP 8.4 with common extensions php8.4 \ php8.4-cli \ php8.4-common \ php8.4-curl \ php8.4-gd \ php8.4-mbstring \ php8.4-mysqli \ php8.4-pdo-mysql \ php8.4-xml \ php8.4-zip \ php8.4-bcmath \ php8.4-intl \ - php8.4-opcache - -# PHP 8.5 with common extensions -RUN apt-get install -y --no-install-recommends \ + php8.4-opcache \ + # PHP 8.5 with common extensions php8.5 \ php8.5-cli \ php8.5-common \ php8.5-curl \ php8.5-gd \ php8.5-mbstring \ php8.5-mysqli \ php8.5-pdo-mysql \ php8.5-xml \ php8.5-zip \ php8.5-bcmath \ php8.5-intl \ php8.5-opcache \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*This consolidation:
- Reduces Docker layers from 6 to 1
- Ensures apt cache is cleaned up once at the end
- Resolves both DL3009 and DL3059 static analysis warnings
- Makes the Dockerfile more maintainable
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
DockerfileREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🧰 Additional context used
🪛 GitHub Actions: Code Lint
Dockerfile
[error] 48-48: Hadolint DL3009: Delete the apt-get lists after installing something.
🪛 GitHub Check: Lint Dockerfile
Dockerfile
[failure] 100-100:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 84-84:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 68-68:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 48-48:
DL3009 info: Delete the apt-get lists after installing something
🔇 Additional comments (4)
Dockerfile (4)
1-1: LGTM: Base image pinned for reproducibility.Pinning the runner base image to a specific version ensures consistent builds and prevents unexpected breakage from upstream changes.
133-139: LGTM: PHP alternatives configured correctly.All PHP versions (8.1-8.5) are properly registered with update-alternatives, and PHP 8.5 is set as the default as intended. The comment accurately reflects the implementation.
141-145: LGTM: Composer installation follows best practices.The Composer installation correctly uses the official installer without the invalid
--version=latestflag (as addressed in previous reviews), allowing it to default to the latest stable release.
115-131: No issues found. PHP 8.5 was officially released as stable GA on November 20, 2025, and all referenced packages (php8.5, php8.5-cli, and all listed extensions) are available in the ondrej/php PPA for supported Ubuntu series (Jammy/22.04 and Noble/24.04). The build will not fail due to missing packages.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Dockerfile (1)
47-49: Consider consolidating PHP installations to reduce image size.The
apt-get updatecreates cached lists that persist across multiple intermediate layers (through PHP 8.1-8.4 installations) until cleanup at line 129-130. While the final image is cleaned, this approach increases intermediate layer sizes.💡 Consolidation approach
Combine the repository setup and all PHP installations into a single RUN statement:
-# Add PHP repository and install PHP 8.1, 8.2, 8.3, 8.4, 8.5 and common extensions -RUN add-apt-repository -y ppa:ondrej/php \ - && apt-get update - -# PHP 8.1 with common extensions -RUN apt-get install -y --no-install-recommends \ +# Add PHP repository and install PHP 8.1, 8.2, 8.3, 8.4, 8.5 and common extensions +RUN add-apt-repository -y ppa:ondrej/php \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + # PHP 8.1 php8.1 \ php8.1-cli \ ... + # PHP 8.2 + php8.2 \ + php8.2-cli \ + ... + # (continue for all versions) + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*This reduces the number of layers and ensures apt cache doesn't persist in intermediate layers.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
DockerfileREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🧰 Additional context used
🪛 GitHub Actions: Code Lint
Dockerfile
[error] 48-48: Hadolint DL3009: Delete the apt-get lists after installing something.
🪛 GitHub Check: Lint Dockerfile
Dockerfile
[failure] 100-100:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 84-84:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 68-68:
DL3059 info: Multiple consecutive RUN instructions. Consider consolidation.
[failure] 48-48:
DL3009 info: Delete the apt-get lists after installing something
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build Check
🔇 Additional comments (8)
Dockerfile (8)
52-65: PHP 8.1 extension set looks good.The extension list is comprehensive and includes common requirements (database, image processing, cryptography, internationalization).
67-81: PHP 8.2 extension set looks good.Extension list is consistent with the other PHP versions.
83-97: PHP 8.3 extension set looks good.Extension list is consistent with the other PHP versions.
99-113: PHP 8.4 installation looks good.Extension set is consistent with other PHP versions. This addresses one of the PR objectives.
132-138: PHP alternatives configuration looks correct.All PHP versions (8.1-8.5) are properly registered with
update-alternatives, and PHP 8.5 is set as the default, consistent with the comment.
140-144: Composer installation looks good.The installation correctly omits the version flag, allowing the installer to default to the latest stable release. This addresses the previous review concern.
1-1: The base imageghcr.io/actions/actions-runner:2.329.0is valid and available in the GitHub Container Registry. This version was released on October 14, 2025, and can be pulled without issues.
115-130: PHP 8.5 is available in the ondrej/php PPA and the Dockerfile code is valid.PHP 8.5 was released GA on November 20, 2025, and is now available in Ondřej Surý's PPA (ppa:ondrej/php) with all requested extensions. Version 8.5.1 is current as of December 2025. The installation will not fail due to package unavailability.
4eceeda to
b174f8e
Compare
🔍 Samenvatting
Deze PR is een aanvulling op #8.
📝 Beschrijving
✅ Checklist