A minimal Python image with init, user, and mimalloc.
10K+
A minimal python image with init, user, and mimalloc.
Tip
RECOMMEND development on
kgrv/python instead of the officialpython:alpine to mitigatemuslperformance issue.
3.14.7, 3.14, 3, latest3.13.15, 3.133.12.14, 3.123.11.16, 3.113.10.21, 3.10| Tags | AMD64 | ARM64 | Description |
|---|---|---|---|
bin | 9.53 MB | 9.81 MB | The smallest footprint without built-in packages |
min | 37.70 MB | 40.40 MB | Layer on bin with built-in packages |
3.x.y | 47.40 MB | 50.70 MB | Base on kgrv/alpine as drop-in replacement for python:alpine |
3.14.3 - 2026-02-09
| OS/ARCH | Description |
|---|---|
linux/amd64 | 64-bit x86 architecture for Linux operating systems |
linux/arm64 | 64-bit ARM architecture for Linux operating systems |
| Type | Container | Availability | Function |
|---|---|---|---|
| Volume | /mnt | >= bin | Optional Bind mount volume |
| Environment | EUID | >= 3.x | Optional Effective User ID |
| Environment | EGID | >= 3.x | Optional Effective Group ID |
| Environment | UMASK | >= 3.x | Optional Default permissions |
| Environment | SUGGEST | >= 3.x | Optional Set suggestion messages |
| Environment | TZ | >= 3.x | Optional Set time zone |
EUID / EGID environment variablesmini:mini as defaultUMASK defaults to 0022SUGGEST defaults to trueFROM kgrv/python:min
tini by using CMD without overriding ENTRYPOINTFROM kgrv/python:min AS staging
...
CMD [ "python", "--version" ]
ENTRYPOINT with "tini", "--"FROM kgrv/python:min AS staging
...
ENTRYPOINT [ "tini", "--", "python" ]
CMD [ "--version" ]
3.x. Override ENTRYPOINT with "tini", "--", "enpt".FROM kgrv/python:3.14 AS develop
...
ENTRYPOINT [ "tini", "--", "enpt", "python" ]
bin, min. Add USER before ENTRYPOINT.FROM kgrv/python:min AS staging
...
USER mini
ENTRYPOINT [ "tini", "--", "python" ]
pipy script is packaged to simplify install process. A script to facilitate installing Python packages.
USAGE: pipy [OPTIONS] [PIP_INSTALL_ARGUMENTS]
EXAMPLES:
pipy --requirement requirements.txt
pipy -n -m --requirement requirements.txt
OPTIONS:
-w, --workspace PATH Path to workspace [/tmp/pipy]
-n, --no-bytecode Disable Python bytecode
-m, --remove-pycache Remove Python cache
-d, --debug Enable debug mode
--version Display version
--help Display usage information
ENVIRONMENT:
Set environment variables to corresponding options
PIPY_WORKSPACE [-w] Path to workspace
PYTHONDONTWRITEBYTECODE [-n] Disable Python bytecode
REMOVE_PYCACHE [-m] Remove Python cache
Check out 'README.md' at https://hub.docker.com/r/kgrv/python
3.x to develop and build dependenciesmin or bin as base image for distributionFROM kgrv/python:3.14 AS deps
COPY requirements.txt .
RUN pipy --no-bytecode --remove-pycache --requirement requirements.txt --debug
FROM kgrv/python:3.14-min AS release
COPY --link src/ .
COPY --link --from=deps --chmod=555 --chown=root:root /tmp/pipy/bin/ /usr/local/bin/
COPY --link --from=deps --chmod=1777 --chown=root:root /usr/local/lib/python/site-packages /usr/local/lib/python/site-packages
USER mini
ENTRYPOINT [ "tini", "--", "python", "run.py" ]
CMD [ "--debug" ]
3.x layer for included /usr/share/zoneinfoFROM kgrv/python:3.14 AS develop
/etc/localtime or /usr/share/zoneinfodocker run -it -v /etc/localtime:/etc/localtime:ro kgrv/python:3.14
docker run -it -v /usr/share/zoneinfo/US/Eastern:/etc/localtime:ro kgrv/python:3.14
docker run -it kgrv/python:min
docker run -it -v $(pwd):/mnt kgrv/python:min
Important
Argument
--useris not supported, please useEUID/EGID.
Note
Only applicable to
3.x.
docker run -it -e EUID=$(id -u) -e EGID=$(id -g) kgrv/python:3.14
Note
Only applicable to
3.x.
docker run -it kgrv/python:3.14 --BECOME_ROOT
Content type
Image
Digest
sha256:e0fb66f53…
Size
17.3 MB
Last updated
about 1 month ago
docker pull kgrv/python