Sign inSign up

flywheel/python-slim

By flywheel

•Updated over 5 years ago

Python base image from python:slim for Flywheel projects

Image
0

10K+

flywheel/python-slim repository overview

⁠flywheel/python-slim and flywheel/python-alpine

Python base images with a common basic toolset for Flywheel projects.

The basic toolset includes:

Two 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⁠.

⁠Usage

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

⁠Development

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

⁠Publishing

Images are published on dockerhub after every successful CI build:

⁠License

MIT

⁠Repository

flywheel-io/tools/img/python⁠

Tag summary

Content type

Image

Digest

Size

159.1 MB

Last updated

over 5 years ago

docker pull flywheel/python-slim