I have a rather complex stack in my Dockerfile. I need to be able to allow gcc
access the Python headers for the pip
to install a lib (py-lmdb
) which has CPython dependency that needs to be built. Unfortunately the Linuxkit distribution does not include Python headers. The gcc
is correctly (check the file list here) pointing to the directory /usr/include/python3.7m/
, but when I tried to check if the files are there, I noticed that such directory does not exist. I believe the other files are from the dependency of python3.7
lib as the python3.7 gets properly installed and works flawlessly.
Only files that apt-get install libpython3.7-dev
is persisting are:
/usr/bin/x86_64-linux-gnu-python3.7-config/usr/bin/x86_64-linux-gnu-python3.7m-config/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/makesetup/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/python-config.py/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu/python.o/usr/lib/x86_64-linux-gnu/libpython3.7m.a/usr/lib/x86_64-linux-gnu/libpython3.7m.so/usr/lib/x86_64-linux-gnu/pkgconfig/python-3.7.pc/usr/lib/x86_64-linux-gnu/pkgconfig/python-3.7m.pc/usr/share/doc/libpython3.7-dev
I am using a multistage build, which does:
FROM maven:slim as builder...FROM tomcat:8.5.53-jdk11-openjdk-slim...
Also:
uname -aLinux b5038a670622 4.19.76-linuxkit #1 SMP Fri Apr 3 15:53:26 UTC 2020 x86_64 GNU/Linuxapt-get install libpython3.7-devReading package lists... DoneBuilding dependency tree Reading state information... Donelibpython3.7-dev is already the newest version (3.7.3-2+deb10u1).0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I would love to understand the root cause of this so to avoid running to this same problem again. This was especially numbing experience as six days of work crashed to the last feature that needed the py-lmdb
(we are building complex machine learning thingie to be trained at AWS Batch Job). We have alternative strategy for building this upon Ubuntu based image, but I would love to understand the issue here to make more educated guesses on choices between base images; some people say that ubuntu still is more stable / better documented / faqed for cloud computing, some say that there should be no difference.
I guess my key question is, why does that apt-get
in Linuxkit
say the libpython3.7-dev
is properly installed, while it lacks most of the files?