-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.linux
More file actions
82 lines (73 loc) · 2 KB
/
Dockerfile.linux
File metadata and controls
82 lines (73 loc) · 2 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
# use the official manylinux2014 image for maximum Linux portability
FROM quay.io/pypa/manylinux2014_x86_64
# install required build tools
RUN yum install -y \
make \
cmake3 \
git \
openssl-devel \
autoconf \
automake \
libtool \
&& yum clean all
WORKDIR /work
# environment variables
ENV DEPS_DIR=/opt/deps
ENV BUILD_DIR=/work/build
ENV ARTIFACT_DIR=/work/artifacts
# -----------------------------
# Build dependencies at image build time
# -----------------------------
RUN set -xe \
&& mkdir -p "$DEPS_DIR"
# --- build GSL ---
RUN set -xe \
&& git clone --depth 1 https://git.savannah.gnu.org/git/gsl.git \
&& cd gsl \
&& autoreconf -i \
&& ./configure \
CFLAGS="-fPIC" \
CXXFLAGS="-fPIC" \
--enable-static \
--disable-shared \
--prefix="$DEPS_DIR" \
&& make -j$(nproc) \
&& make install \
&& cd .. \
&& rm -rf gsl
# --- build Google Test ---
RUN set -xe \
&& git clone --depth 1 https://github.com/google/googletest.git \
&& cd googletest \
&& mkdir build && cd build \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \
-DCMAKE_CXX_STANDARD=17 \
&& make -j$(nproc) \
&& make install \
&& cd ../.. \
&& rm -rf googletest
# --- build Google Benchmark ---
RUN set -xe \
&& git clone --depth 1 https://github.com/google/benchmark.git \
&& cd benchmark \
&& git clone --depth 1 https://github.com/google/googletest.git \
&& mkdir build && cd build \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \
-DCMAKE_CXX_STANDARD=17 \
&& make -j$(nproc) \
&& make install \
&& cd ../.. \
&& rm -rf benchmark
# -----------------------------
# Runtime build entrypoint
# -----------------------------
COPY linux-builder.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/linux-builder.sh
WORKDIR /work
ENTRYPOINT ["linux-builder.sh"]