DEV Community

Discussion on: Dockerfile with fine-tuned Python and native dependencies

Collapse
 
copypasteengineer profile image
CopyPasteEngineer

Not sure what your use case is. Generally, I'll use python as the base image instead of a bare debian. So you can ensure that, when calling python command, it always reaches to the right one. Hence, no need to use pyenv and calling source every time.

Just replace

FROM debian...
Enter fullscreen mode Exit fullscreen mode

with

FROM python:3.8
Enter fullscreen mode Exit fullscreen mode

and remove all the scripts relating to installing python and pyenv.
That should do.

Other dependencies should be able to be installed by apt and pip command.

note: You could find more variation of python base images here:

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Thanks. I forgot about that.

The only real use case is, to be able to choose Operating System to install native deps. I am pretty sure about Ubuntu and half sure about Debian. I barely trust Alpine.