fix: seed nonroot-owned data dir in release Docker image - #49
Open
leonid-shevtsov wants to merge 1 commit into
Open
fix: seed nonroot-owned data dir in release Docker image#49leonid-shevtsov wants to merge 1 commit into
leonid-shevtsov wants to merge 1 commit into
Conversation
Anonymous/named Docker volumes inherited root ownership when /var/lib/mailtrap-local was missing from the image, so SQLite failed with unable to open database file (14). Match Dockerfile by seeding the path from an alpine stage as UID 65532. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe release Dockerfile adds an Alpine preparation stage that seeds ChangesRelease image filesystem setup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Release image (
Dockerfile.goreleaser) declaredVOLUME /var/lib/mailtrap-localbut never created that directory owned by distrolessnonroot(UID 65532). Empty anonymous/named volumes then mounted as root:root, so the process could not createdb.sqlite3(unable to open database file (14)).--tmpfsworked because it is world-writable.Fix: alpine stage seeds an empty dir;
COPY --chown=nonroot:nonrootinto the image (same pattern as the source-buildDockerfile).Local smoke (linux/arm64 binary +
docker build -f Dockerfile.goreleaser):-v /var/lib/mailtrap-local→open store/unable to open database file (14)-v /var/lib/mailtrap-local→ SMTP + HTTP listening; wrotesecret.key+db.sqlite365532:65532How to test
docker run --rm -p 3535:3535 -p 3550:3550 -v /var/lib/mailtrap-local mailtrap/mailtrap-local:<this-build>starts without DB errors; UI at http://127.0.0.1:3550-v mailtrap-local:/var/lib/mailtrap-local(fresh named volume); no manual chownSummary by CodeRabbit