-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
85 lines (73 loc) · 2.49 KB
/
Dockerfile
File metadata and controls
85 lines (73 loc) · 2.49 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
ARG img_repo=python
ARG img_tag=3.14.2-slim-trixie
# This FROM line includes a label so that the dependencies can be built by themselves by using the `--target` argument of `docker build`
FROM ${img_repo}:${img_tag} AS base
ARG build_type=Release
ARG build_examples=FALSE
ARG enable_testing=FALSE
ARG narg=2
# Most dependencies
RUN apt-get update && \
apt-get clean && \
apt-get --fix-missing -y install \
build-essential \
cmake \
# gdb \
git \
libboost-chrono-dev \
libboost-filesystem-dev \
libboost-system-dev \
librabbitmq-dev \
libyaml-cpp-dev \
rapidjson-dev && \
# pybind11-dev \
# wget && \
rm -rf /var/lib/apt/lists/*
# use pybind11_checkout to specify a tag or branch name to checkout
ARG pybind11_checkout=v3.0.1
ARG pybind11_repo=https://github.com/pybind/pybind11.git
ARG pybind11_name=pybind11
RUN cd /usr/local && \
git clone ${pybind11_repo} && \
cd ${pybind11_name} && \
git checkout ${pybind11_checkout} && \
mkdir build && \
cd build && \
cmake -DPYBIND11_TEST=FALSE .. && \
make -j${narg} install && \
cd / && \
rm -rf /usr/local/${pybind11_name}
FROM base AS devel
RUN apt-get update && \
apt-get clean && \
apt-get --fix-missing -y install \
nano \
gdb \
valgrind \
cmake-curses-gui
FROM base
# note that the build dir is *not* in source, this is so that the source can me mounted onto the container without covering the build target
COPY .git /usr/local/src/.git
COPY external /usr/local/src/external
COPY documentation /usr/local/src/documentation
COPY scarab /usr/local/src/scarab
COPY library /usr/local/src/library
COPY executables /usr/local/src/executables
COPY testing /usr/local/src/testing
COPY examples /usr/local/src/examples
COPY CMakeLists.txt /usr/local/src/CMakeLists.txt
COPY dripline_shield.json /usr/local/src/dripline_shield.json
COPY DriplineConfig.cmake.in /usr/local/src/DriplineConfig.cmake.in
RUN mkdir -p /usr/local/build && \
cd /usr/local/build && \
cmake ../src && \
# unclear why I have to run cmake twice
cmake -DCMAKE_BUILD_TYPE=${build_type} \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DDripline_BUILD_EXAMPLES:BOOL=${build_examples} \
-DDripline_ENABLE_TESTING:BOOL=${enable_testing} \
-DDripline_BUILD_PYTHON:BOOL=TRUE \
-DPBUILDER_PY_INSTALL_IN_SITELIB=TRUE \
../src && \
make -j${narg} install
# TODO: rm -rf /usr/local/src