-
Notifications
You must be signed in to change notification settings - Fork 129
/
Dockerfile
104 lines (98 loc) · 3.52 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
# Artery's Docker container does not include any GUI.
# The idea of having Artery in a container is to run multiple instances with different parameter sets, e.g. running a large parameter study on a cluster.
# You may want to use Vagrant for a setup with GUI instead.
FROM debian:bullseye-slim as base
FROM base as omnetpp-build
ARG VERSION=5.6.2
WORKDIR /root
RUN apt-get update && apt-get install -y \
bison \
build-essential \
flex \
libxml2-dev \
wget \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/omnetpp/omnetpp/releases/download/omnetpp-$VERSION/omnetpp-$VERSION-src-core.tgz \
--progress=bar:force:noscroll -O omnetpp-src-core.tgz && \
tar xf omnetpp-src-core.tgz && \
rm omnetpp-src-core.tgz && \
mv omnetpp-$VERSION /omnetpp
WORKDIR /omnetpp
ENV PATH /omnetpp/bin:$PATH
RUN ./configure WITH_QTENV=no WITH_OSG=no WITH_OSGEARTH=no && \
make -j $(nproc) base MODE=release
FROM omnetpp-build as omnetpp-debug
RUN make -j $(nproc) base MODE=debug
FROM base as artery-build
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libboost1.74-dev \
libboost-date-time1.74-dev \
libboost-system1.74-dev \
libcrypto++-dev \
libgeographic-dev \
libpython3.9-dev \
libssl-dev \
libzmq3-dev \
pkg-config \
python3-distutils \
&& rm -rf /var/lib/apt/lists/*
COPY --from=omnetpp-build /omnetpp/bin /omnetpp/bin
COPY --from=omnetpp-build /omnetpp/include /omnetpp/include
COPY --from=omnetpp-build /omnetpp/lib /omnetpp/lib
COPY --from=omnetpp-build /omnetpp/Makefile.inc /omnetpp/Version /omnetpp/
COPY . /artery/source
ENV PATH /omnetpp/bin:$PATH
RUN cmake -S /artery/source -B /artery/build -DCMAKE_BUILD_TYPE=Release -DWITH_OTS=ON -DWITH_SIMULTE=ON \
-DCMAKE_INSTALL_PREFIX=/artery -DCMAKE_INSTALL_RPATH=/artery/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
&& cmake --build /artery/build --parallel $(nproc) --target install
FROM base as sumo-build
ARG VERSION=1_6_0
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libproj-dev \
libxerces-c-dev \
python3 \
python3-setuptools \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/eclipse/sumo/archive/v$VERSION.tar.gz \
--progress=bar:force:noscroll -O sumo-src.tar.gz && \
tar xfz sumo-src.tar.gz && \
rm sumo-src.tar.gz
RUN cmake -S sumo-$VERSION -B build-sumo -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/sumo && \
cmake --build build-sumo --parallel $(nproc) --target install
FROM base as run
RUN apt-get update && apt-get install -y \
libboost-date-time1.74 \
libboost-system1.74 \
libcrypto++ \
libgeographic19 \
libproj19 \
libpython3.9 \
libssl1.1 \
libxerces-c3.2 \
libxml2 \
libzmq5 \
python3 \
make \
&& rm -rf /var/lib/apt/lists/*
COPY --from=omnetpp-build /omnetpp/bin /omnetpp/bin
COPY --from=omnetpp-build /omnetpp/lib /omnetpp/lib
COPY --from=sumo-build /sumo/bin/sumo /sumo/bin/sumo
COPY --from=sumo-build /sumo/share/sumo/data /sumo/share/sumo/data
COPY --from=artery-build /artery/bin /artery/bin
COPY --from=artery-build /artery/lib /artery/lib
COPY --from=artery-build /artery/share/ned /artery/share/ned
ENV SUMO_HOME /sumo/share/sumo
ENV PATH /sumo/bin:/omnetpp/bin:$PATH
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN useradd -m artery
RUN mkdir -p /scenario /results && chown -R artery:users /scenario /results
USER artery
VOLUME /scenario /results
WORKDIR /scenario
ENTRYPOINT ["/artery/bin/run_artery.sh", "--result-dir=/results"]