Repository navigation
refactor: simplify image builds - #28
Conversation
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments: 2
Dockerfile: 1
139-144: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winVerify the GitHub CLI and eza signing-key fingerprints before apt trusts them.
The base stage checks the PostgreSQL key with
sha256sum -c(Line 59). The new dev stage downloads the GitHub CLI keyring and the eza key and then trusts them for apt without any check. The eza key also comes from the movingmainbranch onraw.githubusercontent.com. If either source is compromised or changed, apt accepts packages signed by that key. Those packages then ship in every published-devimage. Key fingerprints rarely change. A fingerprint check is a small, fixed addition and keeps the policy used for the PostgreSQL key.🔒️ Proposed fix
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && gpg --show-keys --with-colons /etc/apt/keyrings/githubcli-archive-keyring.gpg | grep -q "^fpr:::::::::${GH_CLI_KEY_FPR}:" \ && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ ... && curl -fsSL https://raw.githubusercontent.com/eza-community/eza/main/deb.asc \ | gpg --dearmor -o /etc/apt/keyrings/eza.gpg \ + && gpg --show-keys --with-colons /etc/apt/keyrings/eza.gpg | grep -q "^fpr:::::::::${EZA_KEY_FPR}:" \Declare
GH_CLI_KEY_FPRandEZA_KEY_FPRas uppercaseARGs that hold the published fingerprints.docker-bake.hcl: 1
25-27: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRestore a clean-tag function for tag values.
PHP_VERSIONandLATESTare user-overridable inputs. The newtag()function putsnamedirectly into the tag string. The previous tag-cleaning step is removed. Any value with characters that are not valid in a tag, such as/,+, or uppercase letters, now produces an invalid tag reference. The generated tag also feedsimagetools createin the push job. The repository guideline requires a dedicated sanitizer for tag values.♻️ Proposed fix
+function "clean_tag" { + params = [tag] + result = substr(regex_replace(regex_replace(lower(tag), "[^a-z0-9_.-]", "-"), "^[.-]+", ""), 0, 128) +} + function "tag" { params = [name, os, variant] - result = "${IMAGE_NAME}:${name}${os == "trixie" ? "" : "-${os}"}${variant == "dev" ? "-dev" : ""}" + result = "${IMAGE_NAME}:${clean_tag("${name}${os == "trixie" ? "" : "-${os}"}${variant == "dev" ? "-dev" : ""}")}" }As per coding guidelines: "Use semantic versioning for image tags and sanitize tag values with a dedicated clean-tag function."
Also applies to: 47-53
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: QUIET
- Plan: Advanced
- Run ID:
38aff564-8dbc-4587-b82a-5952d4af782b
📒 Files selected for processing: 10
.env.github/workflows/pipeline.yml.zshrc.zshrc.prodAGENTS.mdDockerfileREADME.mddocker-bake.hclusr/local/bin/wipusr/local/bin/x
💤 Files with no reviewable changes: 2
- usr/local/bin/wip
- usr/local/bin/x
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Summary
sqlsrv/pdo_sqlsrvand currentsvgowiphelper and redundantxwrapperWhy
The existing update path required changing versions and checksums throughout the Dockerfile even when only an upstream patch release changed. This keeps intentional compatibility boundaries (PHP/Node/pnpm/Composer major or minor channels and the Debian variants) while allowing routine upstream updates to flow through scheduled builds.
This is the consolidated follow-up to the pinning discussion in #27.
Tag impact
Exact PHP patch tags are no longer generated. Published tags track the supported PHP minor (
php8.4,php8.5) plus the existing latest, PHP-major, Debian, and development aliases.Validation
docker build --pull --build-arg VERSION=8.5-trixie --target dev -t frankenphp:simplified-dev .docker run --rm -v "$PWD/test.php:/test.php:ro" frankenphp:simplified-dev php /test.php devdocker run --rm frankenphp:simplified-dev zsh -i -c 'echo dev-shell-ok'docker build --pull --build-arg VERSION=8.5-trixie --target prod -t frankenphp:simplified-prod .docker run --rm -v "$PWD/test.php:/test.php:ro" frankenphp:simplified-prod php /test.php productiondocker build --pull --build-arg VERSION=8.4-bookworm --target prod -t frankenphp:simplified-bookworm-prod .docker run --rm -v "$PWD/test.php:/test.php:ro" frankenphp:simplified-bookworm-prod php /test.php productiondocker buildx bake --printdocker build --check --build-arg VERSION=8.5-trixie --target dev .actionlint .github/workflows/pipeline.ymlzsh -n .zshrc .zshrc.prodphp -l test.phpgit diff --checkAll local checks passed on arm64; the PR workflow covers both supported architectures.
Summary by CodeRabbit
New Features
Improvements
Documentation
Removed