forked from JanusGraph/janusgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
98 lines (80 loc) · 3.62 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
# Copyright 2023 JanusGraph Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG BASE_IMAGE=eclipse-temurin:11-jre
FROM debian:buster-slim as builder
ARG TARGETARCH
ARG JANUS_VERSION=1.0.0-SNAPSHOT
ARG BUILD_PATH=janusgraph-java-11-1.0.0-SNAPSHOT
ARG YQ_VERSION=3.4.1
ENV JANUS_VERSION=${JANUS_VERSION} \
JANUS_HOME=/opt/janusgraph
WORKDIR /opt
COPY target/${BUILD_PATH}.zip /opt/${BUILD_PATH}.zip
RUN apt update -y && apt install -y gpg unzip curl && \
curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \
unzip -q ${BUILD_PATH}.zip && \
mv ${BUILD_PATH} /opt/janusgraph && \
rm -rf ${JANUS_HOME}/elasticsearch && \
rm -rf ${JANUS_HOME}/javadocs && \
rm -rf ${JANUS_HOME}/log && \
rm -rf ${JANUS_HOME}/examples && \
rm -rf ${JANUS_HOME}/conf/janusgraph-*.properties && \
mv ${JANUS_HOME}/conf/gremlin-server/gremlin-server.yaml ${JANUS_HOME}/conf/janusgraph-server.yaml && \
rm -rf ${JANUS_HOME}/conf/gremlin-server
COPY docker/conf/ ${JANUS_HOME}/conf/
COPY docker/scripts/remote-connect.groovy ${JANUS_HOME}/scripts/
FROM ${BASE_IMAGE}
ARG JANUS_VERSION=1.0.0-SNAPSHOT
ENV JANUS_VERSION=${JANUS_VERSION} \
JANUS_HOME=/opt/janusgraph \
JANUS_CONFIG_DIR=/etc/opt/janusgraph \
JANUS_DATA_DIR=/var/lib/janusgraph \
JANUS_SERVER_TIMEOUT=30 \
JANUS_STORAGE_TIMEOUT=60 \
JANUS_PROPS_TEMPLATE=berkeleyje-lucene \
JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \
gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \
gremlinserver.threadPoolWorker=1 \
gremlinserver.gremlinPool=8
RUN groupadd -r janusgraph --gid=999 && \
useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/janusgraph/ /opt/janusgraph/
COPY --from=builder /opt/yq /usr/bin/yq
COPY docker/docker-entrypoint.sh /usr/local/bin/
COPY docker/load-initdb.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \
chmod 755 /usr/local/bin/load-initdb.sh && \
chmod 755 /usr/bin/yq && \
mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \
chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR}
EXPOSE 8182
WORKDIR ${JANUS_HOME}
USER janusgraph
ENTRYPOINT [ "docker-entrypoint.sh" ]
CMD [ "janusgraph" ]
ARG CREATED=test
ARG REVISION=test
LABEL org.opencontainers.image.title="JanusGraph Docker Image"
LABEL org.opencontainers.image.description="Official JanusGraph Docker image"
LABEL org.opencontainers.image.url="https://janusgraph.org/"
LABEL org.opencontainers.image.documentation="https://docs.janusgraph.org/v1.0/"
LABEL org.opencontainers.image.revision="${REVISION}"
LABEL org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/"
LABEL org.opencontainers.image.vendor="JanusGraph"
LABEL org.opencontainers.image.version="${JANUS_VERSION}"
LABEL org.opencontainers.image.created="${CREATED}"
LABEL org.opencontainers.image.license="Apache-2.0"