Sign inSign up

haizaar/python-minimal

By haizaar

Updated over 4 years ago

Stripped down versions of official Python docker images.

Image
0

1.9K

haizaar/python-minimal repository overview

This repository contains stripped down version of official Python docker images. The aim is to have an image that contains only Python runtime for use in the final stage of multi-stage docker builds when tools like pip are not needed (and even better be avoided to reduce potential attach surface).

Official images (alpine flavor) weigh 75-80MB. These stripped down images are less then 30MB.

More info about my approach on multi-stage builds for Python apps: https://tech.zarmory.com/2018/09/docker-multi-stage-builds-for-python-app.html

GitHub repository: https://github.com/haizaar/docker-python-minimal

Changes to the official images:

  • stripped all of the Python dynamic libraries
  • Removed "dev" part of the install
  • Removed the following Python packages:
    • pip
    • ensurepip
    • idlelib
    • distutils
    • lib2to3

Tag summary

Content type

Image

Digest

Size

11.6 MB

Last updated

over 4 years ago

docker pull haizaar/python-minimal:3.10.2-alpine3.15-1