Skip to content

Clarify that pip wheels are incompatible with alpine-based images #904

Closed

Description

@smallnamespace

The current README.md uses the generic language for other images:

This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice.

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.

Activity

  1. stefansedich commented on Jun 2, 2017

    @stefansedich

    +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.

  2. tao12345666333 commented on Nov 2, 2018

    @tao12345666333

    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.

  3. added a commit that references this issue on Feb 6, 2019
  4. andelf commented on Oct 19, 2019

    @andelf
    echo "manylinux1_compatible = True" > $PYTHON_PATH/_manylinux.py
  5. tianon commented on Nov 5, 2021

    @tianon
    Member

    This isn't necessarily fixed by #1885, but it's slightly more clear now IMO.

  6. tianon commented on Feb 18, 2022

    @tianon
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions