-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.python
More file actions
30 lines (23 loc) · 955 Bytes
/
Dockerfile.python
File metadata and controls
30 lines (23 loc) · 955 Bytes
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
# Dockerfile to build Python 3.13.9 from source with an Alpine image.
# This will be used build the libpython3.13.a file used by the other build processes.
FROM alpine:latest
# Install build dependencies for python and git
RUN sed -i '2s/^# *//' /etc/apk/repositories
RUN apk update && apk add --no-cache build-base git
# Create python directory.
RUN mkdir -p /usr/build/python
WORKDIR /usr/build/python
# Test gcc installed.
RUN gcc --version
# Test make installed.
RUN make --version
# Test git installed.
RUN git --version
# Clone Python 3.13.9 from CPython git repository on GitHub and build it.
RUN git clone --depth 1 --branch v3.13.9 https://github.com/python/cpython
RUN cd cpython && git checkout v3.13.9
RUN cd cpython && ./configure --prefix=/opt/python/3.13.9 --enable-optimizations
RUN cd cpython && make -j$(nproc) PROFILE_TASK="" profile-opt
RUN cd cpython && make install
# Keep container running.
CMD [ "tail", "-f", "/dev/null" ]