Skip to content

Build the Docker image from scratch - #7

Merged
tmphost-dev merged 1 commit into
mainfrom
build/scratch-image
Oct 23, 2026
Merged

tmphost-dev merged 1 commit into
mainfrom
build/scratch-image

Conversation

@tmphost-dev

Copy link
Copy Markdown
Contributor

Moves the final image stage from gcr.io/distroless/static-debian12:nonroot to scratch, following ../tmphost's Dockerfile.

  • The image holds only /app/sql-mcp, /app/public, /etc/ssl/certs/ca-certificates.crt (Postgres TLS, tmphost API, ACME), /etc/passwd and /data. No shell, no package manager, no extra base files.
  • Runs as UID 65532 (nonroot), the same UID as before, so existing volumes need no new chown.
  • AGENTS.md notes that any new runtime need (tzdata, /tmp) has to be copied in.

Tested: built the image (35 MB, was 36.9 MB) and ran it. It starts as nonroot, / and /databases/x return 200, and it creates sqlmcp.db in /data.

🤖 Generated with Claude Code

The final stage held distroless's base files the server never uses. It now
holds only the binary, the web app, CA certs, a passwd entry and /data. The
user keeps UID 65532 so volumes chowned for the old image still work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmphost-dev
tmphost-dev merged commit 3f79af7 into main Oct 23, 2026
2 checks passed
@tmphost-dev
tmphost-dev deleted the build/scratch-image branch October 23, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants