You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by mi...@apache.org on 2023/03/15 06:16:47 UTC

[incubator-hugegraph-toolchain] 01/01: Update Dockerfile

This is an automated email from the ASF dual-hosted git repository.

ming pushed a commit to branch simon824-patch-1
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git

commit abf44f7e786fb96a62689f0eea608992d253467f
Author: Simon Cheung <mi...@apache.org>
AuthorDate: Wed Mar 15 14:16:40 2023 +0800

    Update Dockerfile
---
 hugegraph-hubble/Dockerfile | 43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/hugegraph-hubble/Dockerfile b/hugegraph-hubble/Dockerfile
index 51b0aa24..90cd6f84 100644
--- a/hugegraph-hubble/Dockerfile
+++ b/hugegraph-hubble/Dockerfile
@@ -5,7 +5,9 @@
 # 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
+#
+#    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.
@@ -13,22 +15,37 @@
 # limitations under the License.
 #
 
-FROM ubuntu:xenial
-
+FROM maven:3.9.0-eclipse-temurin-11 AS build
+    
 RUN set -x \
     && apt-get -q update \
-    && apt-get -q install -y --no-install-recommends --no-install-suggests \
-       curl \
-       lsof \
-       g++ \
-       gcc \
-       openjdk-8-jdk \
+    && apt-get install -y nodejs npm \
+    && npm install --global yarn \
     && apt-get clean
 
-ENV HUBBLE_HOME /opt/hugegraph-hubble
-WORKDIR ${HUBBLE_HOME}
+COPY . /pkg
+WORKDIR /pkg
 
-COPY ./hugegraph-hubble $HUBBLE_HOME
-EXPOSE 8088
+RUN set -x \
+    && cd /pkg/hugegraph-hubble/ \
+    && mvn package -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true
+    
+
+FROM openjdk:11-slim
 
+RUN set -x \
+    && apt-get -q update \
+    && apt-get -q install -y --no-install-recommends --no-install-suggests curl lsof g++ gcc \
+    && apt-get clean 
+    
+COPY --from=build /pkg/hugegraph-hubble/apache-hugegraph-hubble-incubating-*/ /hubble
+
+RUN set -e \
+    && sed -i 82{s/nohup//g} /hubble/bin/start-hubble.sh \
+    && sed -i 83{s/\>.*//g} /hubble/bin/start-hubble.sh \
+    && sed -i '84,97d' /hubble/bin/start-hubble.sh
+
+WORKDIR /hubble/
+
+EXPOSE 8088
 ENTRYPOINT ["./bin/start-hubble.sh"]