Python 项目 Docker 化

确定 Docker base image

The best Docker base image for your Python application

So as of June 2019:
1. python:3.7-slim-stretch or python:3.7-stretch (or whatever version of Python you use instead of 3.7) are a reasonable starting point. I suspect for most people the slim variant will result in overall smaller disk usage.
2. If you need more recent libraries or compilers than those provided by Debian Stretch, you probably want to use ubuntu:18.04, which is more up-to-date than CentOS.
3. Once Debian Buster is released, the python images will likely have a buster variant which will be the clear winner: it will have both pre-installed new versions of Python and equivalent or more up-to-date packages than ubuntu:18.04.
4. And when April 2020 comes around, ubuntu:20.04 will take the lead on having the most up-to-date packages.

加速 image 构建

Write a Comment