Python base image from python:slim for Flywheel projects
10K+
Python base images with a common basic toolset for Flywheel projects.
The basic toolset includes:
bashcurlgawkgitgosu (symlinked on alpine to su-exec)jqlessnanopoetrytinitreeyqTwo image variants are available:
flywheel/python-slim based on python:3.8-slim-buster - the recommended
base image hitting a sweet spot between image size and build complexity / time
due to glibc and the support of pre-built wheels.flywheel/python-alpine based on python:3.8-alpine - for projects where a
small image size is important or otherwise the lack of pre-built wheels and the
use of musl is not a concern.Create a Dockerfile within your python project:
FROM flywheel/python-slim:master
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
# install project dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install --no-dev --no-root
# install project
COPY my-project ./
RUN poetry install --no-dev
# use a valid init process and step-down from root
CMD ["tini", "--", "gosu", "flywheel", "my-cmd"]
Create a .dockerignore file that limits the build context:
**
!my-project
!poetry.lock
!pyproject.toml
Edit Dockerfile.slim and Dockerfile.alpine
while keeping the common toolset in sync between the two. Finally make sure to
run the pre-commit hooks:
pre-commit run --all-files
Images are published on dockerhub after every successful CI build:
Content type
Image
Digest
Size
159.1 MB
Last updated
over 5 years ago
docker pull flywheel/python-slim