-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile
104 lines (96 loc) · 2.77 KB
/
Dockerfile
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
104
# Stage 1: Elfutils build stage
FROM ubuntu:22.04 AS elfutils_builder
ARG DEBIAN_FRONTEND=noninteractive
ENV VERS=0.189
# Install elfutils build dependencies
RUN apt-get update \
&& apt-get install -y --force-yes --no-install-recommends software-properties-common gpg-agent \
build-essential \
libzstd-dev \
ca-certificates \
curl \
lsb-release \
bzip2 \
zlib1g-dev \
zlib1g-dev:native \
libbz2-dev \
liblzma-dev \
gettext \
po-debconf \
gawk \
libc6-dbg \
flex \
bison \
pkg-config \
libarchive-dev \
libcurl4-gnutls-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /elfutils \
&& cd /elfutils \
&& curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2 \
&& tar -xf elfutils.tar.bz2 --strip-components 1 \
&& CFLAGS='-w' ./configure --prefix=/usr/local --disable-nls --disable-debuginfod --enable-libdebuginfod=dummy --with-zstd \
&& make install
# Stage 2: Final stage
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update \
&& apt-get install -y --force-yes --no-install-recommends software-properties-common gpg-agent \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get install -y --force-yes --no-install-recommends \
build-essential \
pkg-config \
python3.7-dev \
python3.7-dbg \
python3.7-distutils \
python3.8-dev \
python3.8-dbg \
python3.8-distutils \
python3.9-dev \
python3.9-dbg \
python3.9-distutils \
python3.10-dev \
python3.10-dbg \
python3.10-distutils \
python3.11-dev \
python3.11-dbg \
python3.11-distutils \
python3.12-dev \
python3.12-dbg \
python3.12-venv \
python3.13-dev \
python3.13-dbg \
python3.13-venv \
make \
cmake \
gdb \
git \
valgrind \
lcov \
file \
less \
libzstd-dev \
liblzma-dev \
libbz2-dev \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy the installed files from the elfutils_builder stage
COPY --from=elfutils_builder /usr/local /usr/local
# Set environment variables
ENV PYTHON=python3.12 \
VIRTUAL_ENV="/venv" \
PATH="/venv/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
TZ=UTC \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# Copy the required files
COPY ["requirements-test.txt", "requirements-extra.txt", "requirements-docs.txt", "/tmp/"]
# Install Python packages
RUN $PYTHON -m venv $VIRTUAL_ENV \
&& pip install -U pip wheel setuptools cython pkgconfig \
&& pip install -U -r /tmp/requirements-test.txt -r /tmp/requirements-extra.txt
# Set the working directory
WORKDIR /src