-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.python-base
More file actions
103 lines (97 loc) · 3.36 KB
/
Copy pathDockerfile.python-base
File metadata and controls
103 lines (97 loc) · 3.36 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Layered Python base images for GTSAM CI.
#
# Published targets:
# python-build-glibc -> python-build:py<version>-glibc-trixie
# python-runtime-glibc-trixie -> python-runtime:py<version>-glibc-trixie
# python-runtime-glibc-slim -> python-runtime:py<version>-glibc-trixie-slim
# python-build-musl -> python-build:py<version>-musl-alpine
# python-runtime-musl-alpine -> python-runtime:py<version>-musl-alpine
ARG PYTHON_VERSION=3.14
ARG PYTHON_GLIBC_VARIANT=trixie
ARG PYTHON_ALPINE_VARIANT=alpine3.24
FROM python:${PYTHON_VERSION}-${PYTHON_GLIBC_VARIANT} AS python-build-glibc
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
ca-certificates \
bison \
build-essential \
cmake \
dejagnu \
flex \
git \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-serialization-dev \
libboost-system-dev \
libboost-thread-dev \
libboost-timer-dev \
libeigen3-dev \
libgmp-dev \
libmpc-dev \
libmpfr-dev \
libtbb-dev \
ninja-build \
pkg-config \
> /dev/null && rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src
COPY ci/requirements-build.txt /etc/pip-constraints.txt
ENV PIP_CONSTRAINT=/etc/pip-constraints.txt
RUN python3 -m pip install -q --no-cache-dir --upgrade pip setuptools wheel
# Runtime bases intentionally ship only CA certs. GTSAM's third-party shared
# libraries (Boost, TBB, libstdc++, ...) are injected per-build by the
# runtime-libs collector in the main Dockerfile, resolved via ldd, so these
# bases never need version-pinned Boost/TBB packages that break on distro bumps.
FROM python:${PYTHON_VERSION}-${PYTHON_GLIBC_VARIANT} AS python-runtime-glibc-trixie
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
LD_LIBRARY_PATH=/usr/local/lib
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
ca-certificates \
> /dev/null && rm -rf /var/lib/apt/lists/*
CMD ["python3"]
FROM python:${PYTHON_VERSION}-slim-${PYTHON_GLIBC_VARIANT} AS python-runtime-glibc-slim
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
LD_LIBRARY_PATH=/usr/local/lib
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
ca-certificates \
> /dev/null && rm -rf /var/lib/apt/lists/*
CMD ["python3"]
FROM python:${PYTHON_VERSION}-${PYTHON_ALPINE_VARIANT} AS python-build-musl
ENV PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
RUN apk add -q --no-cache \
bison \
boost-dev \
build-base \
ca-certificates \
cmake \
eigen-dev \
flex \
git \
gmp-dev \
mpfr-dev \
mpc1-dev \
ninja \
pkgconf \
onetbb-dev
WORKDIR /usr/src
COPY ci/requirements-build.txt /etc/pip-constraints.txt
ENV PIP_CONSTRAINT=/etc/pip-constraints.txt
RUN python3 -m pip install -q --no-cache-dir --upgrade pip setuptools wheel
FROM python:${PYTHON_VERSION}-${PYTHON_ALPINE_VARIANT} AS python-runtime-musl-alpine
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
LD_LIBRARY_PATH=/usr/local/lib
RUN apk add -q --no-cache \
ca-certificates
CMD ["python3"]
FROM python-build-glibc AS python-build
FROM python-runtime-glibc-slim AS python-runtime