-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (38 loc) · 1.34 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (38 loc) · 1.34 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
FROM ubuntu AS builder
# suppress input
ARG DEBIAN_FRONTEND=noninteractive
# essential, cmake, git, boost, GMP for Bignum library
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get -y install build-essential git libboost-all-dev libgmp-dev wget && \
apt-get autoremove -y && \
apt-get clean -y
ARG CMAKE_INSTALLER=cmake-3.22.3-linux-x86_64.sh
RUN \
wget https://github.com/Kitware/CMake/releases/download/v3.22.3/${CMAKE_INSTALLER} && \
chmod +x ${CMAKE_INSTALLER}
RUN ./${CMAKE_INSTALLER} --prefix=/usr/local --exclude-subdir
# unittest-cpp
RUN git clone https://github.com/unittest-cpp/unittest-cpp.git
WORKDIR /unittest-cpp/builds
RUN cmake ../
RUN cmake --build ./
RUN cmake --build ./ --target install
# libalgebra_tests build
WORKDIR /libalgebra
COPY . .
WORKDIR /libalgebra/build
ENTRYPOINT cmake -DCMAKE_BUILD_TYPE=Release -DLIBALGEBRA_TESTING=ON .. && cmake --build .
# Run the tests
FROM builder AS tester
ENTRYPOINT cmake -DCMAKE_BUILD_TYPE=Release -DLIBALGEBRA_TESTING=ON .. && cmake --build . && ctest
# docker volume create libalgebra_volume
# docker build -t libalgebra . --target builder
# docker run -v libalgebra_volume:/libalgebra/build -it libalgebra
#
# OR
#
# docker volume create libalgebra_tests_volume
# docker build -t libalgebra_tests . --target tester
# docker run -v libalgebra_tests_volume:/libalgebra/build -it libalgebra_tests