-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify that pip wheels are incompatible with alpine-based images #904
Comments
+1 we are just spinning up some of our Python services into docker and I have since run into this, I attempted to take the route I used for our minimal Ruby containers but soon ran into issues, for now I have moved to 3.5-slim and will eat the larger images but it would be great to seem some compatible manylinux wheels that work with alpine and better clarification in the docs around the caveats. |
In addition, if you pay attention to performance, please check this page http://moelove.info/docker-python-perf/ to see the performance results. The code is here https://github.com/tao12345666333/docker-python-perf. And the pipeline run every week. |
It takes some time to build lxml and alpine is not compatible with Python wheels. docker-library/docs#904 Image size is bigger, but the build time is under reasonable limits. REPOSITORY TAG IMAGE ID CREATED SIZE mike latest 90628b250c16 57 seconds ago 314MB vs macbre/mike latest 9cb9746db092 13 hours ago 177MB
echo "manylinux1_compatible = True" > $PYTHON_PATH/_manylinux.py |
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra is not actively under development. [1] docker-library/docs#904
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra is not actively under development. [1] docker-library/docs#904
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra was previously removed. [1] docker-library/docs#904
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra was previously removed. [1] docker-library/docs#904
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra was previously removed. [1] docker-library/docs#904
Alpine Linux uses musl libc instead of glibc which means it cannot use most pre-built Python wheels for glibc-based Linux distributions [1]. As a result, Python packages need to be built from source, leading to longer build times and increased complexity in the Dockerfile for more complex packages. For complex packages like opencv-python, building from source is especially non-trivial. This commit ports the existing Alpine-based Dockerfile to a minimal Debian-based file with pre-installed Python 3 (the official Python Docker image) and removes dependencies that were originally required to build Python packages from sources (e.g., cvxopt) where installation from a wheel is now possible. This commit also removes all explicit references to Python 2 dependencies, as fauna is compatible enough with Python 3 for downloading to work and sacra was previously removed. [1] docker-library/docs#904
This isn't necessarily fixed by #1885, but it's slightly more clear now IMO. |
I think it's time we finally admit this is as fixed as it is probably going to be -- in the meantime, we got https://www.python.org/dev/peps/pep-0656/ which explicitly documents how to support wheels for musl, so the main concern should decrease over time as more libraries add musl wheels. |
The current README.md uses the generic language for other images:
However, for Python specifically, manylinux wheels are incompatible with MUSL, so any docker images that end up pulling native dependencies via pip will likely end up having to build from source (see pypa/manylinux#37). For a popular library like
pandas
, this is the difference between a 1-minute and a 20-minute build time.This seems like a significant downside to a Python docker image, and probably should be noted in the documentation.
The text was updated successfully, but these errors were encountered: