-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.python314
More file actions
60 lines (52 loc) · 1.54 KB
/
Dockerfile.python314
File metadata and controls
60 lines (52 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Dockerfile for testing with Python 3.14 (free-threading support)
FROM erlang:27-slim
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
curl \
wget \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Build Python 3.14 with free-threading enabled
ARG PYTHON_VERSION=3.14.3
RUN cd /tmp && \
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz && \
tar xf Python-${PYTHON_VERSION}.tar.xz && \
cd Python-${PYTHON_VERSION} && \
./configure --prefix=/usr/local \
--enable-optimizations \
--with-lto \
--disable-gil \
--enable-shared \
LDFLAGS="-Wl,-rpath,/usr/local/lib" && \
make -j$(nproc) && \
make install && \
cd / && rm -rf /tmp/Python-*
# Verify Python installation
RUN python3 --version && \
python3 -c "import sys; print('Free-threading:', hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled())"
# Set environment for rebar3
ENV PYTHON_CONFIG=/usr/local/bin/python3-config
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Create working directory
WORKDIR /app
# Copy source
COPY . /app
# Remove problematic plugin and build
RUN sed -i '/rebar3_ex_doc/d' rebar.config || true && \
rm -rf _build && \
rebar3 compile
# Run tests
CMD ["rebar3", "ct", "--readable=compact"]