chore: docker compose build で PHP バージョンを TAG で切り替え可能にする#6813
Conversation
ec-cube2 の EC-CUBE/ec-cube2#1405 と同様に、ec-cube サービスへ build セクションと pull_policy: missing を追加する。 - build.context / build.args.TAG / build.pull を追加し、image のタグと 同じ環境変数 TAG を共有させることで、手動の docker build + docker tag を不要にする - pull_policy: missing により、通常の docker compose up は従来どおり registry (ghcr.io) からイメージを取得する挙動を維持する - 手動ビルド用コメントを TAG 環境変数ベースの手順に置き換え (例: TAG=8.3-apache docker compose build) Co-Authored-By: Claude <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughdocker-compose.yml の ec-cube サービス定義で、 変更内容Docker Compose Configuration
推定レビュー工数🎯 2 (Simple) | ⏱️ ~10 分 Possibly related PRs
推奨レビュアー
概要docker-compose.yml の ec-cube サービス定義において、TAG 変数を用いたイメージ指定とビルド設定(context、args、pull、pull_policy)が追加・明確化されました。ローカルビルド手順のコメントも同時に更新されています。 詩
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker-compose.yml`:
- Line 30: docker-compose.yml's default TAG value (${TAG:-8.1-apache}) diverges
from the Dockerfile ARG TAG=8.1-apache-bullseye, causing the compose build to
override the Dockerfile default; update the compose defaults so
${TAG:-8.1-apache-bullseye} (and any image: ...:${TAG:-...} usages) match the
Dockerfile ARG TAG value, ensuring consistency between docker-compose.yml's TAG
variable and the Dockerfile's ARG TAG.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.4 #6813 +/- ##
============================================
+ Coverage 75.10% 75.33% +0.23%
Complexity 6752 6752
============================================
Files 483 483
Lines 26279 26277 -2
============================================
+ Hits 19736 19797 +61
+ Misses 6543 6480 -63
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
概要(Overview・Refs Issue)
ec-cube2 の EC-CUBE/ec-cube2#1405 と同様に、
docker compose buildで環境変数TAGを指定するだけで任意の PHP バージョンのイメージをローカルビルドできるようにします。これまで必要だった手動のdocker build+docker tagの手順を不要にします。方針(Policy)
ec-cubeサービスにbuildセクションとpull_policy: missingを追加build.args.TAGをimageのタグと同じ環境変数${TAG:-8.1-apache}で共有し、ビルドするタグと付与されるイメージ名を常に一致させるpull_policy: missingにより、通常のdocker compose upは従来どおり registry (ghcr.io) からイメージを取得する挙動を維持実装に関する補足(Appendix)
変更は
docker-compose.ymlのみです。手動ビルド用のコメントも環境変数ベースの手順に置き換えています。
DB バックエンドを指定する場合は
COMPOSE_FILEと併用します。テスト(Test)
docker compose configで構成が正しく解決されることを確認済みです。args.TAG: 8.1-apache/image: ghcr.io/ec-cube/ec-cube-php:8.1-apacheTAG=8.3-apache指定時:args.TAGとimageのタグが連動して8.3-apacheに切り替わるマイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目
Summary by CodeRabbit