Skip to content

Commit 5ad6549

Browse files
committed
docker: Clean up nogil base
1 parent f3ceed9 commit 5ad6549

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

docker/Dockerfile.nogil

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
# syntax=docker/dockerfile:1
21
##############################################################
3-
# This Dockerfile builds a base image with a free-threaded
4-
# build of Python 3.13.
5-
#
6-
# This is EXPERIMENTAL and intended for development and
7-
# testing purposes only.
2+
# Builds a base image with free-threaded Python 3.13
83
##############################################################
94

105
ARG FROM_IMAGE=ubuntu:22.04
@@ -27,9 +22,7 @@ RUN git clone --depth 1 --branch 3.13 https://github.com/python/cpython.git /usr
2722

2823
WORKDIR /usr/src/cpython
2924

30-
# Configure, compile, and install Python with the free-threaded build
31-
# --disable-gil: The key flag to enable the free-threaded build
32-
# --enable-optimizations: Apply profile-guided optimizations for better performance
25+
# Configure, build, and install Python 3.13 with the GIL disabled
3326
RUN ./configure --prefix=/opt/python3 --disable-gil --enable-optimizations
3427
RUN make -j$(nproc)
3528
RUN make install
@@ -39,19 +32,16 @@ FROM $FROM_IMAGE
3932

4033
ARG DEBIAN_FRONTEND=noninteractive
4134

42-
# Copy our Python build from the builder stage
35+
# Copy Python build from the previous stage
4336
COPY --from=builder /opt/python3/ /opt/python3/
4437

45-
# Set the PATH to include our custom Python build
38+
# Set the PATH to include custom Python build
4639
ENV PATH="/opt/python3/bin:${PATH}"
4740

48-
# Install essential runtime dependencies.
49-
# Downstream images are responsible for installing Devito-specific
50-
# dependencies such as compilers/MPI.
41+
# Install some Python runtime dependencies
5142
RUN apt-get update && apt-get install -y \
5243
libnuma-dev && \
5344
rm -rf /var/lib/apt/lists/*
5445

5546
RUN python3 -m pip install --upgrade pip && \
5647
python3 -m pip cache purge
57-

0 commit comments

Comments
 (0)