From 6bed18025adf30e05c7fd54c5596f5cb5ec42525 Mon Sep 17 00:00:00 2001 From: coderzc Date: Mon, 5 Dec 2022 21:26:36 +0800 Subject: [PATCH] add with hubble dockerfile --- DockerfileWithHubble | 51 +++++++++++++++++++ .../src/assembly/travis/build-image.sh | 8 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 DockerfileWithHubble diff --git a/DockerfileWithHubble b/DockerfileWithHubble new file mode 100644 index 0000000000..af865662fd --- /dev/null +++ b/DockerfileWithHubble @@ -0,0 +1,51 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# + +FROM openjdk:11-slim + +LABEL maintainer="HugeGraph Docker Maintainers " + +ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=50 -XshowSettings:vm" + +COPY . /hugegraph/hugegraph-server +WORKDIR /hugegraph/hugegraph-server + +# 1. Install environment +RUN set -x \ + && apt-get -q update \ + && apt-get -q install -y --no-install-recommends --no-install-suggests \ + dumb-init \ + procps \ + curl \ + lsof \ + && apt-get clean + +# 2. Init HugeGraph Sever +RUN set -e \ + && cd /hugegraph/hugegraph-server/ \ + && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties \ + && ./bin/init-store.sh + +# 2. Init HugeGraph Hubble +RUN set -e \ + && cd /hugegraph/hugegraph-server/hugegraph-hubble \ + && sed -i "s/^hubble.host.*$/hubble.host=http:\/\/0.0.0.0:8080/g" ./conf/hugegraph-hubble.properties \ + +EXPOSE 8080 8088 + +ENTRYPOINT [ "/usr/bin/dumb-init", "--" ] +CMD ["hugegraph-hubble/bin/start-hubble.sh && bin/start-hugegraph.sh"] diff --git a/hugegraph-dist/src/assembly/travis/build-image.sh b/hugegraph-dist/src/assembly/travis/build-image.sh index a57d7e8e49..9e94852b83 100755 --- a/hugegraph-dist/src/assembly/travis/build-image.sh +++ b/hugegraph-dist/src/assembly/travis/build-image.sh @@ -28,4 +28,10 @@ CONTEXT_PATH=$(mvn -f "${PROJECT_POM_PATH}" -q -N \ -Dexec.executable='echo' -Dexec.args='${final.name}') CONTEXT_PATH="${PROJECT_PATH}/${CONTEXT_PATH}" -docker build -t $1 $CONTEXT_PATH -f $PROJECT_PATH/Dockerfile +if [ -n "$2" ]; then + wget $2 -O hugegraph-hubble.tar.gz + tar -zxf hugegraph-hubble.tar.gz -C $CONTEXT_PATH + docker build -t $1 $CONTEXT_PATH -f $PROJECT_PATH/DockerfileWithHubble +else + docker build -t $1 $CONTEXT_PATH -f $PROJECT_PATH/Dockerfile +fi