How To Configure Shebang Line Of Internal Python Tools
I am trying to build a minimal docker image, capable of nothing more but running the Python interpreter. During development I start from alpine, the final image will be build FROM
Solution 1:
A common convention in Autoconf-based build systems is to support a Make variable DESTDIR
. When you run make install
, if DESTDIR
is set, it actually installs into the configured directory under DESTDIR
, but still built with the original path. You can then create an archive of the target directory, or in a Docker context, use that directory as the build context.
cd Python-3.8.7
# Use the final install target as the --prefix
./configure --prefix=/python
# Installs into e.g. ../python/python/bin/python3.8
make install DESTDIR=../python
cd ../python
tar cvzf ../python.tar.gz .
You can see this variable referenced in the Python Makefile in many places.
Post a Comment for "How To Configure Shebang Line Of Internal Python Tools"