4 ms·
It's pretty popular to install Python C-extensions from packages, called wheels. Otherwise you need to compile from source, which means you need build dependenc
by horstmeyer 5y ago
It's pretty popular to install Python C-extensions from packages, called wheels.
Otherwise you need to compile from source, which means you need build dependencies.
So Python and Alpine doesn't really go that well together. In my experience debian-slim as Docker base image is also small, and less painful.
- nickjj 5y agoI remember trying out and writing about Alpine vs Debian in the context of Docker images a few years ago and I remember someone commented saying with Alpine they got substantially worse performance when using Python to connect to a PostgreSQL database using the official Python pg package (it requires C dependencies) in an isolated benchmark that performed a bunch of reads. I don't base any decisions around micro benchmarks but that example struck me as interesting because this was a case where the performance difference between using Alpine and Debian was real and affected user level applications. For the last few years I also run Debian Slim for my base Docker images and don't worry about it. Yes my images might be a little larger than Alpine but it's non-issue in the real world. For smaller scale deploys once the base image is pulled down initially it's there in both cases, so now it comes down to pulling app level changes (code or package deps) which is comparable in size with both distros. And for huge scale deployments it doesn't matter because typically you'd use custom ISOs with as much pre-loaded static content as possible, so you could easily bake in a specific Debian Slim image into the ISO so when you pull down your application image at deploy time it skips having to pull the base image entirely negating any wins that Alpine might have had for pull speeds and network usage. Sure Alpine has less attack surface since it's a smaller code base but we're comparing it to Debian here. They have a 28 year track record of being unbelievably dependable and well supported.
- bassdropvroom 5y agoAs I understand it, wheels support is coming to musl. I cannot remember where I read this, but it must have been on some issue related to this.
- d18g 5y agoPEP: https://www.python.org/dev/peps/pep-0656/ https://www.python.org/dev/peps/pep-0656/
- horstmeyer 5y agoThat's cool! It is already possible to allow installation of many wheels in a hacky way: https://github.com/pypa/pip/issues/3969#issuecomment-247381915 https://github.com/pypa/pip/issues/3969#issuecomment-2473819... But that's a pretty bad idea in most cases I guess. Good to see that Musl might be supported properly.
- deleted 5y ago[deleted]