refactor(cd): drop the dedicated stage for the scratch image's /tmp - #475
Conversation
#474 added a `tmpdir` stage whose only job was `mkdir -m 1777 /empty-tmp`. build-base's own /tmp is already empty, so copying that instead gets the same result with no extra stage. The 1777 was not doing anything either: podman reports /tmp as 755 root-owned in the image built either way, and with COPY --chmod=1777 too. The CD runs as root, which is why the mode never mattered. Verified by building the gcp target with podman and listing the exported image: `tmp/` is present, identical to the image #474 produced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3WmpdY3zc555sNdkY9dzQ
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughThe Dockerfile removes the ChangesDocker image build
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change removes a redundant build stage while preserving the explicit /tmp directory needed for deployment portability; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Follow-up to #474, answering @lionello's question there: no, that line is not needed.
build-base's own/tmpis empty (verified:ls -la /tmpin that stage shows nothing but.and..), so it can be copied directly and thetmpdirstage goes away.The
-m 1777was not doing anything either. Listing the exported image,/tmpcomes outdrwxr-xr-xroot-owned in all three variants — thetmpdirstage as merged, a plain copy frombuild-base, and a copy with--chmod=1777. The CD runs as root, so the mode never mattered.What does still matter is that the directory is copied rather than conjured by
WORKDIR, which is builder-specific: BuildKit materialises it, buildah/podman does not, and the image then dies at deploy time withunable to create tmp directory for workspace: stat /tmp: no such file or directory. That part of #474 stays.Verified by building the
gcptarget with podman and confirmingtmp/is present in the exported image, identical to what #474 produced.Summary by CodeRabbit