Repository navigation
Add the Laravel for Rust dev image (ALI-2447) - #1
Conversation
…(ALI-2447) Moved from aliasproject/docker-php#23, where it was reviewed and tested on amd64 and arm64: a dev image for Laravel for Rust apps as Ingot runs them (Rust 1.99, Node 24, the Laravel CLI 0.3.0 checked against its sha256, an entrypoint that installs node_modules before laravel dev, tini as PID 1, Cargo cache folders writable by group 0). build.yml builds it on native amd64 and arm64 runners and runs smoke-test.sh, which makes a new app with laravel new --rust and checks laravel dev serves /up, restarts on an edit, writes files as the calling user and stops promptly. Publishing to ghcr.io/aliasproject/laravel-rust stays off until the PUBLISH_IMAGES repository variable is true.
The amd64 run failed 'the entrypoint didn't install node_modules' although /up had answered (laravel dev can't start without node_modules). grep -q exits at its first match; docker logs, still writing, then fails, and pipefail fails the whole check. arm64 passed only by timing. The log checks now read the logs into a string first, and the container check compares docker ps output instead of piping it.
Review findings on the new workflow and smoke test: - With PUBLISH_IMAGES on, a manual run on any branch would have tagged that branch's image as dev, the tag Ingot pulls. Publishing now also requires refs/heads/main. - The publish job can't be cancelled part-way by a newer run (its own concurrency group), so dev and dev-<sha> aren't split. - Jobs time out (45 and 10 minutes) instead of GitHub's 6 hours. - The restart check also waits for cargo's Finished after nodemon's restart line, since the old server answers /up until it's killed. - laravel migrate waits for Postgres to accept connections first. - The final rm in cleanup can't fail a passing run. - The README says Markdown-only changes don't trigger a build.
|
Review round 1 (fresh reviewer). The CI: the first amd64 run failed "the entrypoint didn't install node_modules" even though Findings:
Confirmed to hold:
|
Round 2 review: the workflow-level concurrency group still cancelled an older run on main, publish job included, so the job-level group didn't keep dev and dev-<sha> together. Runs on main now queue; other refs still cancel. And pg_isready over the Unix socket can answer during the image's first-start temporary server, before Postgres listens on TCP, which the app uses; it now checks 127.0.0.1.
|
Review rounds 2 and 3
Round 3 also confirmed that |
Part of ALI-2446. This moves the Laravel for Rust dev image out of docker-php (aliasproject/docker-php#23, closed in favour of this PR) into its own repo, and adds CI that builds and boots it. Ingot runs it for Laravel for Rust projects (aliasproject/ingot#19, merged).
What's in it
laravel-rust/Dockerfile.devanddocker-entrypoint: unchanged from docker-php#23's final head (ca4859b), which had three review rounds and was tested by hand on arm64 (M1) and amd64:rustfmtandclippy, and Node 24.sha256.sum.node_modulesbeforelaravel dev.tinias PID 1..github/workflows/build.yml: builds the image on a native amd64 runner and a nativeubuntu-24.04-armrunner. It runs on pull requests, pushes tomain, a Monday rebuild (no layer cache) and manual runs..github/scripts/smoke-test.sh: the hand tests from docker-php#23, made repeatable. On each architecture it:laravel new --rust, as the runner's UID 1001 in group 0, with the Cargo cache volumes mounted;laravel migrateon its own and checks that it doesn't installnode_modules;laravel devagainst Postgres 17 and waits for/upto answer 200;node_modules, and thattarget/andnode_modules/belong to the runner's user;src/and waits for the server to restart and answer again;docker stoptakes under 5 seconds..github/workflows/secret-scan.yml(onmain): the same gitleaks scan as docker-php.Publishing is off
Merging publishes nothing. Publishing turns on when the repository variable
PUBLISH_IMAGESis set totrue. From then on, pushes tomain, the weekly rebuild and manual runs work like this:ghcr.io/aliasproject/laravel-rustby digest, without a tag.devanddev-<commit>, but only if both architectures passed.Pull requests never publish. After the first publish, make the
laravel-rustpackage public in its GHCR settings, because Ingot pulls without logging in.devis the tag Ingot runs today (project.LaravelRustImage). A scheme by Rust version, such as1.99-dev, would need that constant changed too.Testing
actionlintandshellcheckpass.