Python 3.7 Docker images

前端 未结 2 845
滥情空心
滥情空心 2021-02-01 15:03

I want to dockerize my python app. I went to Docker hub and discovered that there are a variety of likely-sounding base images.

3.7.0-stretch, 3.7-stretch, 3-st         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 15:54

    The Github repo with Dockerfiles is here, but it's very dynamic and not easily readable:

    https://github.com/docker-library/python

    The readme is also located here:

    https://github.com/docker-library/docs/tree/master/python

    Looks like info about stretch is really missing. Could not find even in git revision history if it was accidentally removed.

    I have created an issue: https://github.com/docker-library/python/issues/343

    Stretch is a codename for Debian 9 - currently the stable version (until 2019-07-06, when Debian 10 Buster was released). The "oldstable" Debian 8 has codename Jessie.

    https://wiki.debian.org/DebianReleases

    My personal recommendation is to use the minimalistic Alpine images and fallback to the Debian ones if something doesn't work :)

    Comparison of Debian vs. Alpine (from the Docker point of view if possible):

    • https://www.turnkeylinux.org/blog/alpine-vs-debian

    • https://nickjanetakis.com/blog/the-3-biggest-wins-when-using-alpine-as-a-base-docker-image

    From my limited experience the most notable difference is apt vs. apk and GNU libc6 vs. musl libc. And Alpine uses busybox instead of the full versions of many system commands.

    Update: Many Python wheels with compiled binary code will work with Debian-based images, but have to be recompiled (by pip install) for Alpine-based images. In these cases I recommend to use the Debian-based images.

提交回复
热议问题