5 ms·
Using alpine with Python in production is usually a mistake. Python is considerably slower with musl libc than with glibc and on top of that no one is providin
by calpaterson 5y ago
Using alpine with Python in production is usually a mistake. Python is considerably slower with musl libc than with glibc and on top of that no one is providing built wheels for musl-based platforms so you need to drag in the entire buildchain to package most projects. Who wants to build numpy from scratch as part of their build pipeline? And having a C compiler present is not great as it allows exploits to escalate their seriousness considerably.
Anyway most of these security scanners are bunkum:
https://pythonspeed.com/articles/docker-security-scanner/ https://pythonspeed.com/articles/docker-security-scanner/
There are not, in fact, a huge number of known and unpatched vulnerabilities in debian stable. If your tool is finding numerous problems, it is time to look more closely at your tool.
- nickjj 5y ago> Python is considerably slower with musl libc than with glibc I've noticed this years ago too. Interacting with the pg package (PostgreSQL) which has a C dependency was noticeably slower on Alpine vs Debian when performing common database operations like selecting data. Since around 2018'ish I've been using Debian (Slim) and haven't looked back. Haven't had a single issue.
- tyingq 5y agoIt seems like it's usually down to musl's malloc being slower than glibc's. They are working on a new malloc. https://github.com/richfelker/mallocng-draft https://github.com/richfelker/mallocng-draft
- jrochkind1 5y agoInteresting. I have heard from people anecdotally that ruby is in fact a lot faster on alpine/musl-libc. Can anyone confirm that? If so, I wonder what the difference between python and ruby is. (when they seem fairly similar languages from the outside).
- otabdeveloper4 5y agoThat's by design. Glibc is a huge PITA but it's very carefully engineered for best performance.
- whoknowswhat11 5y agoI spent way to long learning this lesson (building packages from scratch).