From a2b935194fe7beae1f18694301c4940b3f5cc4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=B6sche?= Date: Thu, 7 Mar 2024 12:01:35 +0100 Subject: [PATCH] [fixpython][feat] Update to Python 3.12 / Debian Bookworm --- Dockerfile | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ba2f20..59884ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ # This is the Fix Inventory Python container. It includes CPython and is used # as the common base for all the other containers. -FROM ubuntu:20.04 as build-env +FROM python:3.12.2-bookworm as build-env ENV DEBIAN_FRONTEND=noninteractive ARG TARGETPLATFORM ARG BUILDPLATFORM -ARG PYTHON_VERSION=3.11.3 ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN echo "I am running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}" @@ -42,25 +41,16 @@ RUN apt-get -y install \ cargo \ linux-headers-generic -# Download and install CPython -WORKDIR /build/python -RUN curl -L -o /tmp/python.tar.gz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -RUN tar xzvf /tmp/python.tar.gz --strip-components=1 -C /build/python -RUN ./configure --enable-optimizations --prefix /usr/local/python -RUN make -j 12 -RUN make install -RUN /usr/local/python/bin/python3 -m ensurepip - # Create CPython venv WORKDIR /usr/local -RUN /usr/local/python/bin/python3 -m venv fix-venv-python3 +RUN python3 -m venv fix-venv-python3 # Download and install Python test tools RUN . /usr/local/fix-venv-python3/bin/activate && python -m pip install -U pip wheel tox flake8 # Setup main image -FROM ubuntu:20.04 +FROM python:3.12.2-bookworm ENV DEBIAN_FRONTEND=noninteractive ENV LANG="en_US.UTF-8" COPY --from=build-env /usr/local /usr/local @@ -99,7 +89,7 @@ RUN apt-get update \ linux-headers-generic \ dumb-init \ iproute2 \ - libffi7 \ + libffi8 \ openssl \ procps \ dateutils \