https://github.com/crafterkolyan/tiny-python-docker-image
The most lightweight python docker image possible
https://github.com/crafterkolyan/tiny-python-docker-image
docker docker-image lightweight python small tiny
Last synced: 8 months ago
JSON representation
The most lightweight python docker image possible
- Host: GitHub
- URL: https://github.com/crafterkolyan/tiny-python-docker-image
- Owner: CrafterKolyan
- License: mit
- Created: 2021-04-05T21:15:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T04:43:23.000Z (over 1 year ago)
- Last Synced: 2024-04-11T05:53:26.801Z (over 1 year ago)
- Topics: docker, docker-image, lightweight, python, small, tiny
- Language: Python
- Homepage:
- Size: 104 KB
- Stars: 40
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Tiny Python Docker image
========================The most lightweight Python 3 Docker image possible.
.. image:: https://github.com/CrafterKolyan/tiny-python-docker-image/actions/workflows/update-repository.yml/badge.svg?branch=main
:target: https://github.com/CrafterKolyan/tiny-python-docker-image/actions/workflows/update-repository.ymlPossible variants
-----------------.. csv-table::
:header: Dockerfile,Description,Size,Version
:widths: 10, 70, 10, 10Dockerfile.scratch-minimal,Minimal Python image with almost no libraries from scratch,7.3 MB,3.12.9
Dockerfile.scratch-full,Smallest Python image with default libraries from scratch,22.99 MB,3.12.9
Dockerfile.haizaar-minimal,Stripped official Python image (`haizaar/python-minimal`_),35.65 MB,3.13.2
Dockerfile.python-alpine,Python Alpine-based Official,44.97 MB,3.13.2
Dockerfile.alpine,Alpine-based,48.56 MB,3.12.9
Dockerfile.ubuntu,Ubuntu-based,116.7 MB,3.12.3
Dockerfile.python-slim,Minimal packages needed to run python,120.9 MB,3.13.2
Dockerfile.python,Python Debian-based Official with a lot of packages,1018 MB,3.13.2Requirements
------------
- DockerUsage
-----
Building image
``````````````
.. code-block:: bashdocker build -t python-tiny . -f
For example:
.. code-block:: bash
docker build -t python-tiny . -f Dockerfile.scratch-full
Running image
`````````````
.. code-block:: bashdocker run --rm -it python-tiny
Technologies
------------
- Docker
- :code:`ldd` (prints the shared libraries required by each program or shared library specified on the command line): used to create :code:`scratch-full` and :code:`scratch-minimal` images.Related links
-------------
- https://xebia.com/blog/how-to-create-the-smallest-possible-docker-container-of-any-image/
- https://xebia.com/blog/create-the-smallest-possible-docker-container/Related projects
----------------
- https://github.com/jfloff/alpine-python
- https://github.com/haizaar/docker-python-minimal.. _haizaar/python-minimal: https://github.com/haizaar/docker-python-minimal