forked from riebl/vanetza
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
143 lines (133 loc) · 4.83 KB
/
Copy pathDockerfile
File metadata and controls
143 lines (133 loc) · 4.83 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
FROM debian:bullseye-slim AS build
ARG CARGO_HOME=/root/.cargo
ENV TZ=Europe/Lisbon
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN printf "deb http://archive.debian.org/debian-archive/debian bullseye-backports main non-free\ndeb-src http://archive.debian.org/debian-archive/debian bullseye-backports main non-free\n" > /etc/apt/sources.list.d/backports.list
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake/bullseye-backports \
cmake-data/bullseye-backports \
git \
curl \
mosquitto \
libboost-date-time-dev \
libmosquittopp-dev \
libboost-program-options-dev \
libboost-system-dev \
libasio-dev \
libtinyxml2-dev \
libcrypto++-dev \
libgeographic-dev \
libgps-dev \
libssl-dev \
libnl-3-dev \
libnl-genl-3-dev \
zlib1g-dev \
libcurl4-openssl-dev \
ca-certificates \
file \
&& rm -rf /var/lib/apt/lists/*
# Zenoh dependencies
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="${CARGO_HOME}/bin:${PATH}"
RUN cargo --version
WORKDIR /tmp
RUN git clone https://github.com/eclipse-zenoh/zenoh-c.git \
&& cd zenoh-c \
&& git checkout 1.4.0 \
&& mkdir build && cd build \
&& cmake .. -DZENOHC_BUILD_WITH_UNSTABLE_API=true -DZENOHC_BUILD_WITH_SHARED_MEMORY=true -DCMAKE_INSTALL_PREFIX=/usr/local \
&& cmake --build . --config Release \
&& cmake --build . --target install
WORKDIR /tmp
RUN git clone https://github.com/eclipse-zenoh/zenoh-cpp.git \
&& cd zenoh-cpp \
&& git checkout 1.4.0 \
&& mkdir build && cd build \
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DZENOHCXX_ENABLE_TESTS=OFF -DZENOHCXX_ENABLE_EXAMPLES=OFF -Dzenohc_DIR=/usr/local/lib/cmake/zenohc \
&& cmake --build . --target install
# Prometheus dependencies
WORKDIR /tmp
RUN git clone https://github.com/jupp0r/prometheus-cpp.git
WORKDIR /tmp/prometheus-cpp
RUN git submodule update --init
RUN git checkout a944ec100251019cd44d070bbf2fd22f5139d6d0
RUN cmake -B_build -DCPACK_GENERATOR=DEB -DBUILD_SHARED_LIBS=ON
RUN cmake --build _build --target package --parallel $(nproc)
RUN dpkg -i _build/*.deb
# DDS dependencies
WORKDIR /tmp
RUN git clone https://github.com/eProsima/foonathan_memory_vendor.git
RUN mkdir /tmp/foonathan_memory_vendor/build
WORKDIR /tmp/foonathan_memory_vendor/build
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_SHARED_LIBS=ON
RUN cmake --build . --target install --parallel $(nproc)
WORKDIR /tmp
RUN git clone https://github.com/eProsima/Fast-CDR.git
RUN mkdir /tmp/Fast-CDR/build
WORKDIR /tmp/Fast-CDR/build
RUN cmake ..
RUN cmake --build . --target install --parallel $(nproc)
WORKDIR /tmp
RUN git clone https://github.com/eProsima/Fast-DDS.git
WORKDIR /tmp/Fast-DDS/
RUN git checkout v2.13.2
RUN mkdir /tmp/Fast-DDS/build
WORKDIR /tmp/Fast-DDS/build
RUN cmake ..
RUN cmake --build . --target install --parallel $(nproc)
# Vanetza
RUN mkdir /vanetza
COPY . /vanetza
WORKDIR /vanetza
RUN rm -f CMakeCache.txt
RUN cmake .
RUN cmake --build . --target socktap -j $(nproc)
RUN cp /vanetza/bin/socktap /usr/local/bin/socktap
FROM debian:bullseye-slim AS final
ENV TZ=Europe/Lisbon
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#RUN printf "deb http://httpredir.debian.org/debian buster-backports main non-free\ndeb-src http://httpredir.debian.org/debian buster-backports main non-free\n" > /etc/apt/sources.list.d/backports.list
RUN apt-get update && apt-get install -y --no-install-recommends \
mosquitto \
libboost-date-time1.74.0 \
libmosquittopp1 \
libboost-program-options1.74.0 \
libboost-system1.74.0 \
libtinyxml2-8 \
libcrypto++ \
libgeographic19 \
libnl-3-dev \
libnl-genl-3-dev \
libssl1.1 \
zlib1g \
iproute2 \
libgps-dev \
iptables \
bridge-utils \
ebtables \
tcpdump \
libcurl4-openssl-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/lib/ocaml \
&& rm -rf /usr/bin/ocam* \
&& rm -rf /usr/lib/$(uname -m)-linux-gnu/perl \
&& rm -rf /usr/lib/$(uname -m)-linux-gnu/perl-base \
&& rm -rf /usr/lib/$(uname -m)-linux-gnu/libperl*\
&& rm -rf /usr/share/perl \
&& rm -rf /usr/bin/perl \
&& rm -rf /usr/share/doc/*
WORKDIR /
ENV EMBEDDED_MOSQUITTO_PORT=1883
COPY --from=build /vanetza/bin/socktap /usr/local/bin/socktap
COPY --from=build /vanetza/tools/socktap/config.ini /config.ini
COPY --from=build /vanetza/tools/socktap/zenoh_config.json5 /zenoh_config.json5
COPY --from=build /vanetza/entrypoint.sh /entrypoint.sh
COPY --from=build /usr/local/lib/libfast* /usr/local/lib
COPY --from=build /usr/local/lib/libfoon* /usr/local/lib
COPY --from=build /tmp/prometheus-cpp/_build/*.deb /deps/
COPY --from=build /usr/local/lib/libzenoh* /usr/local/lib/
RUN dpkg -i /deps/*.deb
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]