-
Notifications
You must be signed in to change notification settings - Fork 211
/
Dockerfile
103 lines (84 loc) · 2.8 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
# SPDX-License-Identifier: BSD-3-Clause
FROM ubuntu:20.04 AS builder
LABEL vendor="pkumod"
LABEL description="gStore RDF Database Engine"
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
wget \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
libboost-system-dev \
curl \
libcurl4 \
libcurl4-openssl-dev \
libssl-dev \
libzmq3-dev \
pkg-config \
zlib1g-dev \
uuid-dev \
libjemalloc-dev \
libreadline-dev
RUN wget https://cmake.org/files/v3.23/cmake-3.23.2.tar.gz \
&& tar -xvf cmake-3.23.2.tar.gz \
&& cd cmake-3.23.2 \
&& ./bootstrap \
&& make -j$(nproc) \
&& make install \
&& cd ..
RUN mkdir -p /src
WORKDIR /usr/src/gstore
RUN mkdir .tmp
# Copy gStore source code; run `make tarball` to generate this file
ADD gstore.tar.gz /usr/src/gstore
RUN mkdir -p build
RUN cd build && cmake ..
RUN cd build && make pre && make -j$(nproc)
FROM ubuntu:20.04 AS runtime
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
RUN apt-get update && apt-get install -y \
libboost-regex1.71.0 \
libboost-system1.71.0 \
libboost-thread1.71.0 \
libcurl4 \
uuid-runtime \
libjemalloc2 \
libreadline8 \
libopenmpi3 \
coreutils \
g++-9 \
gcc-9 \
libssl-dev \
libzmq3-dev \
libopenmpi3 \
&& rm -rf /var/lib/apt/lists/*
# executable files and library files
COPY --from=builder /usr/src/gstore/bin/ /gstore/bin/
COPY --from=builder /usr/src/gstore/pfn/ /gstore/pfn/
COPY --from=builder /usr/src/gstore/lib/ /gstore/lib/
COPY --from=builder /usr/src/gstore/src/Query/Algorithm/PathQueryHandler.h /gstore/src/Query/Algorithm/PathQueryHandler.h
COPY --from=builder /usr/src/gstore/src/Database/CSR.h /gstore/src/Database/CSR.h
# configure files
COPY --from=builder /usr/src/gstore/conf/ /gstore/conf/
COPY --from=builder /usr/src/gstore/data/ /gstore/data/
COPY --from=builder /usr/src/gstore/api/ /gstore/api/
COPY --from=builder /usr/src/gstore/scripts/ /gstore/scripts/
COPY --from=builder /usr/src/gstore/docs/ /gstore/docs/
COPY --from=builder /usr/src/gstore/README.md /gstore/README.md
COPY --from=builder /usr/src/gstore/README_ZH.md /gstore/README_ZH.md
COPY --from=builder /usr/src/gstore/LICENSE /gstore/LICENSE
# Entry Point Script
COPY scripts/docker-entrypoint.sh /
WORKDIR /gstore/
VOLUME [ "/gstore/" ]
RUN echo "* - nofile 65535" >> /etc/security/limits.conf \
&& echo "* - noproc 65535" >> /etc/security/limits.conf
EXPOSE 9000
# Default API service is ghttp
# Default root password is 123456
# For example: docker run -itd -p 9999:9000 gstore:latest
ENTRYPOINT ["/gstore/bin/ghttp"]