What are the most popular Docker images for Python?
There was a question at work about what the most popular Docker container image for running Python code was? I didn't have an answer, so I asked on Twitter to see if a clear answer could be gleaned.
The first poll asked what people's favourite Python Docker image, and the results were:
- Alpine: 54%
- Stretch (full or slim): 20%
- Jessie (full or slim): 15%
- Windows Server Core: 11%
Now this result surprised me. I wasn't expecting Alpine Linux to win out for two reasons. One is I honestly assumed that most people were not that familiar with the distribution since it isn't as well-known as Debian. The second is that Alpine isn't compatible with manylinux wheels from PyPI, but then again most people probably build their wheels from sdists once and then include them in their image, so the cost of creating the wheel is paid only once per version.
There were also some comments on Twitter that Python on Alpine Linux wasn't as fast as on Debian, with the assumption that musl just wasn't optimized for certain things that Python relied on (I have no idea if this is true in general or just for certain cases that the people who commented happened to run into).
After I ran this poll, though, someone mentioned I left out Anaconda images as options. So I ran the poll again with the following results:
- anaconda3:38%
- miniconda: 30%
- Alpine: 24%
- other: 8%
Now to start, these results are skewed heavily towards data science due to Anaconda Inc. and it's co-founder, Peter Wang retweeting the poll. But even with that skew, Alpine still does surprisingly well.
I was also pleasantly surprised at how well miniconda did. While the lighter-in-size miniconda would be better for download size of an image compared to a full-sized Anaconda image, I personally didn't expect miniconda to have that much exposure to lead to people preferring it enough to have that good of a showing.
So what does all of this mean? Technically nothing since this wasn't exactly a rigorous survey 😉. But as a core developer it does suggest that it would be useful if someone provided a buildbot that was running Alpine Linux. And as a Python user it suggests that I should at least consider using Alpine Linux.