-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
101 lines (72 loc) · 4.43 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
FROM bringauto/cpp-build-environment:latest AS cmlib_cache_builder
WORKDIR /home/bringauto
ARG CMLIB_REQUIRED_ENV_TMP_PATH=/home/bringauto/cmlib_cache
COPY CMakeLists.txt /home/bringauto/module-gateway/CMakeLists.txt
COPY CMLibStorage.cmake /home/bringauto/module-gateway/CMLibStorage.cmake
COPY cmake/Dependencies.cmake /home/bringauto/module-gateway/cmake/Dependencies.cmake
WORKDIR /home/bringauto/module-gateway/build
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_GET_PACKAGES_ONLY=ON
FROM bringauto/cpp-build-environment:latest AS mission_module_builder
ARG MISSION_MODULE_VERSION=v1.2.11
# Install mission module dependencies
WORKDIR /home/bringauto/modules/
ARG CMLIB_REQUIRED_ENV_TMP_PATH=/home/bringauto/modules/cmlib_cache
RUN mkdir /home/bringauto/modules/cmake && \
wget -O CMakeLists.txt https://github.com/bringauto/mission-module/raw/"$MISSION_MODULE_VERSION"/CMakeLists.txt && \
wget -O CMLibStorage.cmake https://github.com/bringauto/mission-module/raw/"$MISSION_MODULE_VERSION"/CMLibStorage.cmake && \
wget -O cmake/Dependencies.cmake https://github.com/bringauto/mission-module/raw/"$MISSION_MODULE_VERSION"/cmake/Dependencies.cmake
WORKDIR /home/bringauto/modules/package_build
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_GET_PACKAGES_ONLY=ON
# Build mission module
WORKDIR /home/bringauto
ADD --chown=bringauto:bringauto https://github.com/bringauto/mission-module.git#$MISSION_MODULE_VERSION mission-module
WORKDIR /home/bringauto/mission-module/_build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/home/bringauto/modules/mission_module/ \
-DFLEET_PROTOCOL_BUILD_EXTERNAL_SERVER=OFF .. && \
make install
FROM bringauto/cpp-build-environment:latest AS io_module_builder
ARG IO_MODULE_VERSION=v1.3.1
# Install io module dependencies
WORKDIR /home/bringauto/modules
ARG CMLIB_REQUIRED_ENV_TMP_PATH=/home/bringauto/modules/cmlib_cache
RUN mkdir /home/bringauto/modules/cmake && \
wget -O CMakeLists.txt https://github.com/bringauto/io-module/raw/"$IO_MODULE_VERSION"/CMakeLists.txt && \
wget -O CMLibStorage.cmake https://github.com/bringauto/io-module/raw/"$IO_MODULE_VERSION"/CMLibStorage.cmake && \
wget -O cmake/Dependencies.cmake https://github.com/bringauto/io-module/raw/"$IO_MODULE_VERSION"/cmake/Dependencies.cmake
WORKDIR /home/bringauto/modules/package_build
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_GET_PACKAGES_ONLY=ON
# Build io module
WORKDIR /home/bringauto
ADD --chown=bringauto:bringauto https://github.com/bringauto/io-module.git#$IO_MODULE_VERSION io-module
WORKDIR /home/bringauto/io-module/_build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/home/bringauto/modules/io_module/ \
-DFLEET_PROTOCOL_BUILD_EXTERNAL_SERVER=OFF .. && \
make install
FROM bringauto/cpp-build-environment:latest AS transparent_module_builder
ARG TRANSPARENT_MODULE_VERSION=v1.0.1
WORKDIR /home/bringauto/
ADD --chown=bringauto:bringauto https://github.com/bringauto/transparent-module.git#$TRANSPARENT_MODULE_VERSION transparent-module
WORKDIR /home/bringauto/transparent-module/_build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/home/bringauto/modules/transparent_module/ \
-DFLEET_PROTOCOL_BUILD_EXTERNAL_SERVER=OFF .. && \
make install
FROM bringauto/cpp-build-environment:latest
WORKDIR /home/bringauto/module-gateway
RUN mkdir -p /home/bringauto/module-gateway/cmlib_cache
ARG CMLIB_REQUIRED_ENV_TMP_PATH=/home/bringauto/module-gateway/cmlib_cache
COPY --chown=bringauto:bringauto . /home/bringauto/module-gateway/tmp
COPY resources/config/for_docker.json /home/bringauto/config/for_docker.json
COPY --from=cmlib_cache_builder /home/bringauto/cmlib_cache /home/bringauto/module-gateway/cmlib_cache
# Install module-gateway
RUN mkdir -p /home/bringauto/module-gateway/tmp/build && \
mkdir /home/bringauto/log && \
cd /home/bringauto/module-gateway/tmp/build && \
cmake /home/bringauto/module-gateway/tmp -DCMAKE_BUILD_TYPE=Release -DBRINGAUTO_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/home/bringauto/module-gateway && \
make -j 8 && \
make install && \
rm -rf /home/bringauto/module-gateway/tmp
# Copy module libraries
COPY --from=mission_module_builder /home/bringauto/modules /home/bringauto/modules
COPY --from=io_module_builder /home/bringauto/modules /home/bringauto/modules
COPY --from=transparent_module_builder /home/bringauto/modules /home/bringauto/modules
EXPOSE 1636