Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (47 loc) 路 1.48 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (47 loc) 路 1.48 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
# Build stage
FROM ubuntu:26.04
ARG DEBIAN_FRONTEND=noninteractive
LABEL org.opencontainers.image.source="https://github.com/bloomberg/pystack"
# Install runtime dependencies
RUN apt-get update \
&& apt-get install -y --force-yes --no-install-recommends \
build-essential \
pkg-config \
make \
cmake \
gdb \
git \
valgrind \
lcov \
file \
less \
libcrypt-dev \
libzstd-dev \
liblzma-dev \
libbz2-dev \
zlib1g-dev \
libdw-dev \
libelf-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /etc/debuginfod/*.urls
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set environment variables
ENV VIRTUAL_ENV="/venv" \
PATH="/venv/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin" \
PYTHONDONTWRITEBYTECODE=1 \
TZ=UTC
# Install Python interpreters via uv, and install setuptools for each
RUN uv_versions="3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15" \
&& uv python install --no-config $uv_versions \
&& for ver in $uv_versions; do \
PATH=/root/.local/bin /usr/local/bin/uv pip install --system --break-system-packages --python=python$ver setuptools; \
done
# Copy the required files
COPY pyproject.toml /tmp/
# Install Python packages
RUN uv venv $VIRTUAL_ENV \
&& uv pip install pip wheel setuptools cython pkgconfig \
&& uv pip install --group "/tmp/pyproject.toml:test" --group "/tmp/pyproject.toml:extra"
# Set the working directory
WORKDIR /src