44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
FROM ubuntu:plucky
|
|
|
|
# Install build dependencies and tools
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
build-essential \
|
|
checkinstall \
|
|
zlib1g-dev \
|
|
libncurses5-dev \
|
|
libgdbm-dev \
|
|
libnss3-dev \
|
|
libssl-dev \
|
|
libreadline-dev \
|
|
libffi-dev \
|
|
libsqlite3-dev \
|
|
libbz2-dev \
|
|
tk-dev \
|
|
liblzma-dev \
|
|
wget \
|
|
tar \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
|
|
|
|
# Download Python 3.12.11 source
|
|
RUN wget https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tgz -O /tmp/Python-3.12.11.tgz \
|
|
&& tar -xvf /tmp/Python-3.12.11.tgz -C /tmp \
|
|
&& rm /tmp/Python-3.12.11.tgz
|
|
|
|
# Change to source directory
|
|
WORKDIR /tmp/Python-3.12.11
|
|
|
|
# Configure the build
|
|
RUN ./configure --enable-optimizations --enable-shared --prefix=/usr
|
|
|
|
# Compile
|
|
RUN make -j $(nproc)
|
|
|
|
RUN make altinstall DESTDIR=/tmp/python-build \
|
|
&& mkdir -p /tmp/python-build/DEBIAN \
|
|
&& echo "Package: python3.12-custom\nVersion: 3.12.11-1\nSection: custom\nPriority: optional\nArchitecture: amd64\nMaintainer: you@example.com\nDescription: Custom Python 3.12.11 build" > /tmp/python-build/DEBIAN/control \
|
|
&& dpkg-deb --build /tmp/python-build /python3.12-custom_3.12.11-1_amd64.deb \
|
|
&& rm -rf /tmp/python-build
|
|
|
|
CMD ["/bin/bash", "-c", "cp /python3.12-custom_3.12.11-1_*.deb /build/"] |