Why does it take ages to install Pandas on Alpine Linux

前端 未结 8 1402
孤独总比滥情好
孤独总比滥情好 2020-11-29 18:19

I\'ve noticed that installing Pandas and Numpy (it\'s dependency) in a Docker container using the base OS Alpine vs. CentOS or Debian takes much longer. I created a little t

8条回答
  •  被撕碎了的回忆
    2020-11-29 19:00

    Real honest advice here, switch to Debian based image and then all your problems will be gone.

    Alpine for python applications doesn't work well.

    Here is an example of my dockerfile:

    FROM python:3.7.6-buster
    
    RUN pip install pandas==1.0.0
    RUN pip install sklearn
    RUN pip install Django==3.0.2
    RUN pip install cx_Oracle==7.3.0
    RUN pip install excel
    RUN pip install djangorestframework==3.11.0
    

    The python:3.7.6-buster is more appropriate in this case, in addition, you don't need any extra dependency in the OS.

    Follow a usefull and recent article: https://pythonspeed.com/articles/alpine-docker-python/:

    Don’t use Alpine Linux for Python images Unless you want massively slower build times, larger images, more work, and the potential for obscure bugs, you’ll want to avoid Alpine Linux as a base image. For some recommendations on what you should use, see my article on choosing a good base image.

提交回复
热议问题