DEV Community

loading...

Discussion on: The best Docker base image for your Python application

pmutua profile image
Philip Mutua Author

@lucian Apologies if the you feel the answer seemed biased in your opinion. I would like to hear out your suggestions that might support your opinion .

Thread Thread
lucian profile image
Lucian BLETAN

Well, debian doesn't install code from source.
In your example I can see WHL

Collecting matplotlib
  Downloading matplotlib-3.1.2-cp38-cp38-manylinux1_x86_64.whl (13.1 MB)
Collecting pandas
  Downloading pandas-0.25.3-cp38-cp38-manylinux1_x86_64.whl (10.4 MB)
Enter fullscreen mode Exit fullscreen mode

WHL format was developed as a quicker and more reliable method of installing Python software than re-building from source code every time. WHL files only have to be moved to the correct location on the target system to be installed.

If I take a look on your alpine docker build I clearly see .tgz that means the pip manager install all from source.
I don't have much time for test and give you a clear feedback but you can test it yourself by building from source on debian and see how much time it's take.

Wheel packages pandas and numpy for example are not supported in images based on Alpine platform.

You can also wget a .whl in your alpine and install with cmd:
pip install pandas-**.whl