imbajin commented on code in PR #440:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/440#discussion_r1136770331


##########
hugegraph-hubble/Dockerfile:
##########
@@ -5,30 +5,47 @@
 # 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.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 
-FROM ubuntu:xenial
-
+FROM maven:3.9.0-eclipse-temurin-11 AS build
+    

Review Comment:
   extra spaces here?



##########
hugegraph-hubble/Dockerfile:
##########
@@ -5,30 +5,47 @@
 # 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.
 # See the License for the specific language governing permissions and
 # 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 \

Review Comment:
   1. why we need to remove `nohup`, seems it's enough just remove `&` to avoid 
it running in bg?
   2. consider add a option like server, use `start-hubble.sh -d false` is 
better? (**latest code** line may change easily)



##########
hugegraph-hubble/Dockerfile:
##########
@@ -5,30 +5,47 @@
 # 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.
 # See the License for the specific language governing permissions and
 # 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 

Review Comment:
   maybe we don't need `curl / lsof / g++ / gcc` here? 
   
   maybe we could remove the whole step



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to