Skip to content

build: try ghcr.io/oioki/python-base-image for distroless targets#7959

Draft
oioki wants to merge 1 commit into
masterfrom
oioki/try-public-python-base-image
Draft

build: try ghcr.io/oioki/python-base-image for distroless targets#7959
oioki wants to merge 1 commit into
masterfrom
oioki/try-public-python-base-image

Conversation

@oioki
Copy link
Copy Markdown
Member

@oioki oioki commented May 21, 2026

Summary

Swap the application-distroless and application-distroless-debug base images from ghcr.io/getsentry/dhi/python:3.13-debian13(-dev) to ghcr.io/oioki/python-base-image/python:3.13-debian13(-dev).

This is draft / showcase only — demonstrating that a community-built distroless Python image can be a drop-in for DHI here. Not intended to merge.

What's the replacement image

oioki/python-base-image — a distroless Python 3.13 base built from scratch on Debian 13. Multi-arch (amd64+arm64), published to GHCR.

Same layout as DHI:

  • Python at /opt/python/bin/python3
  • LD_LIBRARY_PATH=/opt/python/lib
  • CA bundle at /etc/ssl/certs/ca-certificates.crt
  • ENTRYPOINT python3
  • UID/GID 65532 nonroot (snuba's distroless_prep overwrites /etc/passwd anyway)

Difference vs DHI: build is a plain Dockerfile that walks CPython's shared-library closure (ldd-driven, transitive) rather than apko/melange-style exclusion lists. Resulting image is 73.7 MB (vs DHI's 83.6 MB measured locally).

Test plan

  • docker buildx build --target application-distroless . — green locally
  • Resulting image: 842 MB (vs 864 MB with DHI baseline)
  • CI on this branch builds both application-distroless and application-distroless-debug

Known caveat (pre-existing, NOT caused by this change)

Running snuba --help against the resulting distroless image fails with ModuleNotFoundError: No module named 'encodings' — the venv's pyvenv.cfg still references /usr/local/bin from the build image. The DHI-based image (current master) fails identically, so this PR doesn't regress anything. A fix is a one-line sed in distroless_prep but is intentionally out of scope here.

🤖 Generated with Claude Code

Swap the application-distroless and application-distroless-debug FROMs
from ghcr.io/getsentry/dhi/python:3.13-debian13(-dev) to
ghcr.io/oioki/python-base-image/python:3.13-debian13(-dev).

The replacement is a drop-in: same /opt/python layout, same
LD_LIBRARY_PATH, same CA bundle path. Multi-arch images (amd64+arm64)
are published from https://github.com/oioki/python-base-image and
built by walking CPython's shared-library closure rather than apko/
melange-style exclusion lists.

For showcase only — draft.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant