Python Docker base images
Requirements on Python container base images
Choice of base images can have a non-trivial impact on overall long term success of a Python based project. Some of the typical requirements concern:
- Compatibility
- Version of the Python interpreter version
- Binary our source-code compatibility of compiled components
- Security
- Traceability & trustability of code
- Updates for discovered security bugs
- System hardening
- Performance
- Maintainability
There is a nice discussion by Itamar Turner-Trauring of some of the ways these requirements can be satisfied and traded off at https://pythonspeed.com/articles/base-image-python-docker-images/
Reproducing official images or making customised images
Often the official Python docker images are sufficient. But if you have specialised requirements such as below we can help:
- Removing unnecessary features to reduce the attack surface
- Building from your own Python source for maximum supply chain assurance
- Building with patches against official source
- Enabling or disabling specific optimisations or CPU instructions
Tools:
Hardening of Python deployment containers
One available option is using Cython to compile some or all of the Python source code into binary executable code.
Tools:
Copyright and published by: Software Build Factory (C) 2024 Contact info@softwarebuildfactory.com