Python base images
100K+
Python base image for Flywheel projects, coming with
flywheel:flywheel user - just set USER flywheel in the last layer/var/metrics folder for storing multiprocessing metrics - just set
ENV PROMETHEUS_MULTIPROC_DIR=/var/metricsaria2 - fast downloaderbash - recommended shell for scriptsbusybox - unix toolkit (ps, ping, etc.)fd - faster and better findjo - emit json from cli argsjq - json manipulationmicro - dev-friendly text editorrg - faster and better grepsd - faster and better sedtemplar - jinja2-style template cliuv - faster and better pipwatchexec - live reloaderxh - secure and dev-friendly curlyq - yaml manipulationzstd - fast, lossless compression alg-build variant contains git and sshCI pipelines on the main branch push the following tagging scheme to
DockerHub:
flywheel/python:{PYTHON_VER}-{BASE_IMAGE} - the recommended prod base imageflywheel/python:{PYTHON_VER}-{BASE_IMAGE}-build - build variant with git and sshAvailable PYTHON_VERs: 3.12 (default), 3.11, 3.10, 3.9
Available BASE_IMAGEs: alpine (default), debian (bookworm)
The default 3.12-alpine is also tagged as latest, e.g.:
flywheel/python:latest === :3.12-alpineflywheel/python:build === :3.12-alpine-buildCommit-specific tags are available for improved reproducibility, e.g.:
flywheel/python:3.12-debian-d34db33fCreate a .dockerignore to keep the context limited to the files added:
# exclude everything
**
# include files needed
!myproj
!pyproject.toml
!README.md
!requirements.txt
# re-exclude cruft
**/__pycache__
Create a Dockerfile:
FROM flywheel/python:3.12-alpine AS base
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
WORKDIR /src
COPY requirements.txt ./
RUN uv pip install -rrequirements.txt
CMD ["my-app"]
EXPOSE 8000
FROM base AS dev
COPY requirements-dev.txt ./
RUN uv pip install -rrequirements-dev.txt
COPY . .
RUN python -m compileall -bqj0 . && \
fd -epy -E__init__.py -xrm . && \
uv pip install --no-deps -e.
FROM base AS prod
COPY --from=dev /src .
RUN uv pip install --no-deps -e.
USER flywheel
Content type
Image
Digest
sha256:61d586a89…
Size
292.2 MB
Last updated
about 22 hours ago
docker pull flywheel/python:build