Skip to content

Commit 56fb604

Browse files
committed
intro Dockerfile.build for reuse
1 parent d95deed commit 56fb604

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

Dockerfile.build

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Dockerfile for building HugeGraph
19+
# 1st stage: build source code
20+
FROM maven:3.9.0-eclipse-temurin-11
21+
22+
COPY . /pkg
23+
WORKDIR /pkg
24+
ARG MAVEN_ARGS
25+
26+
RUN mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l
27+
RUN rm ./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/dist/*.tar.gz && rm ./hugegraph-store/dist/*.tar.gz

hugegraph-pd/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#
1717

1818
# Dockerfile for HugeGraph PD
19-
# 1st stage: build source code (refer to hugegraph-server/Dockerfile)
20-
2119
# 2nd stage: runtime env
2220
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
2321
FROM openjdk:11-slim
2422

25-
COPY --from=build /pkg/hugegraph-pd/dist/hugegraph-pd-*/ /hugegraph-pd/
23+
COPY --from=hugegraph/hugegraph.build /pkg/hugegraph-pd/dist/hugegraph-pd-*/ /hugegraph-pd/
2624
LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
2725

2826
# TODO: use g1gc or zgc as default

hugegraph-server/Dockerfile

+2-11
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,11 @@
1616
#
1717

1818
# Dockerfile for HugeGraph Server
19-
# 1st stage: build source code
20-
FROM maven:3.9.0-eclipse-temurin-11 AS build
21-
22-
COPY . /pkg
23-
WORKDIR /pkg
24-
ARG MAVEN_ARGS
25-
26-
RUN mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l && rm ./hugegraph-server/*.tar.gz
27-
2819
# 2nd stage: runtime env
29-
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
20+
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
3021
FROM openjdk:11-slim
3122

32-
COPY --from=build /pkg/hugegraph-server/apache-hugegraph-incubating-*/ /hugegraph-server/
23+
COPY --from=hugegraph/hugegraph.build /pkg/hugegraph-server/apache-hugegraph-incubating-*/ /hugegraph-server/
3324
LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
3425

3526
# TODO: use g1gc or zgc as default

hugegraph-store/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#
1717

1818
# Dockerfile for HugeGraph Store
19-
# 1st stage: build source code (refer to hugegraph-server/Dockerfile)
20-
2119
# 2nd stage: runtime env
2220
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
2321
FROM openjdk:11-slim
2422

25-
COPY --from=build /pkg/hugegraph-store/dist/hugegraph-store-*/ /hugegraph-store/
23+
COPY --from=hugegraph/hugegraph.build /pkg/hugegraph-store/dist/hugegraph-store-*/ /hugegraph-store/
2624
LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
2725

2826
# TODO: use g1gc or zgc as default

0 commit comments

Comments
 (0)