Skip to content

Commit 81b5473

Browse files
committed
Dockerfile: Install Python 3.12.13
This commit updates the Dockerfile to manually install Python 3.12.13 from source since there is no pre-built Python 3.12 package available for Debian 10. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent cbfebef commit 81b5473

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM debian:10
22

3+
ARG PYTHON_VERSION=3.12.13
34
ARG CMAKE_VERSION=3.30.5
45
ARG NINJA_VERSION=1.12.1
56
ARG QEMU_VERSION=8.2.2
@@ -73,6 +74,7 @@ RUN <<EOF
7374
make \
7475
nasm \
7576
patch \
77+
pkg-config \
7678
python \
7779
python3 \
7880
python3-dev \
@@ -95,6 +97,34 @@ RUN <<EOF
9597
tree
9698
EOF
9799

100+
# Install packages required for building Python
101+
RUN <<EOF
102+
apt-get install -y --no-install-recommends \
103+
libbz2-dev \
104+
libffi-dev \
105+
libgdbm-dev \
106+
liblzma-dev \
107+
libncurses5-dev \
108+
libnss3-dev \
109+
libreadline-dev \
110+
libsqlite3-dev \
111+
libssl-dev \
112+
zlib1g-dev
113+
EOF
114+
115+
# Install Python
116+
RUN <<EOF
117+
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz
118+
tar Jxf Python-${PYTHON_VERSION}.tar.xz
119+
pushd Python-${PYTHON_VERSION}
120+
./configure --enable-optimizations --with-ensurepip=install
121+
make -j$(nproc)
122+
make altinstall
123+
popd
124+
rm -rf Python-${PYTHON_VERSION}
125+
rm Python-${PYTHON_VERSION}.tar.xz
126+
EOF
127+
98128
# Install CMake
99129
RUN <<EOF
100130
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${HOSTTYPE}.sh

0 commit comments

Comments
 (0)