-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.linux
42 lines (33 loc) · 1 KB
/
Dockerfile.linux
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
FROM ubuntu:20.04
RUN apt update -y
RUN DEBIAN_FRONTEND=noninteractive apt install git cmake gcc g++ libssl-dev -y
WORKDIR /app
# Download and compile mongo c driver
RUN cmake --version
RUN \
mkdir temp \
&& cd temp \
&& git clone https://github.com/mongodb/mongo-c-driver.git \
&& cd mongo-c-driver \
&& git checkout 1.17.1
RUN \
cd temp \
&& cd mongo-c-driver \
&& echo 1.17.1 | tee VERSION_CURRENT \
&& mkdir cmake-build \
&& cd cmake-build \
&& cmake -DCMAKE_INSTALL_PREFIX=out -DCMAKE_PREFIX_PATH=out .. \
&& cmake --build . --config RelWithDebInfo --target install \
&& cd ../../../ \
&& cp -r ./temp/mongo-c-driver/cmake-build/out ./ \
&& mv ./out ./mongo-c-driver
COPY . .
# Build gmod module
RUN \
mkdir build \
&& cd build \
&& export CMAKE_PREFIX_PATH=$(realpath ../mongo-c-driver) \
&& echo $CMAKE_PREFIX_PATH \
&& cmake .. \
&& cmake --build . --config Release
ENTRYPOINT ["bash"]