Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# 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.
#

# NOTE: This file intentionally stays minimal.
**/target/
# Most patterns (IDE files, build artifacts, logs, OS files) are already
# covered by .gitignore. Only Docker-specific extras are listed here.
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated

# Git internals (never tracked by git, must be explicit here)
.git
.gitignore
.gitattributes
.github

# Docker compose files not needed in build context
**/docker-compose*.yml
**/docker-compose*.yaml

# Docs not needed in build context
**/*.md
docs/
3 changes: 1 addition & 2 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:

jobs:
build-server:
# TODO: we need test & replace it to ubuntu-24.04 or ubuntu-latest
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
env:
USE_STAGE: 'false' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
Expand Down
26 changes: 13 additions & 13 deletions hugegraph-pd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -16,15 +17,21 @@
#

# Dockerfile for HugeGraph PD
# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY.
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg

# Copy pom files first — layer is only invalidated when pom files change,
# keeping the Maven cache mount warm across source-only changes.
COPY --parents **/pom.xml ./
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
ARG MAVEN_ARGS

Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \
./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz
COPY . .
RUN --mount=type=cache,target=/root/.m2 \
mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \
&& rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
Expand All @@ -38,25 +45,18 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max
HUGEGRAPH_HOME="hugegraph-pd" \
STDOUT_MODE="true"

#COPY . /hugegraph/hugegraph-pd
WORKDIR /hugegraph-pd/

# 1. Install environment and init HugeGraph Sever
RUN set -x \
&& rm /var/lib/dpkg/info/libc-bin.* \
&& apt-get -q clean \
&& apt-get -q update \
# 1. Install runtime dependencies
RUN apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
dumb-init \
procps \
curl \
lsof \
vim \
cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& service cron start \
&& pwd && cd /hugegraph-pd/
&& rm -rf /var/lib/apt/lists/*

# 2. Init docker script
COPY hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh .
Expand Down
26 changes: 13 additions & 13 deletions hugegraph-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -16,18 +17,24 @@
#

# Dockerfile for HugeGraph Server
# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY.
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg

# Copy pom files first — layer is only invalidated when pom files change,
# keeping the Maven cache mount warm across source-only changes.
COPY --parents **/pom.xml ./
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
ARG MAVEN_ARGS

RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \
./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz
COPY . .
RUN --mount=type=cache,target=/root/.m2 \
mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \
&& rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
FROM eclipse-temurin:11-jre-jammy

COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/
Expand All @@ -39,25 +46,18 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max
HUGEGRAPH_HOME="hugegraph-server" \
STDOUT_MODE="true"

#COPY . /hugegraph/hugegraph-server
WORKDIR /hugegraph-server/

# 1. Install environment and init HugeGraph Sever
RUN set -x \
&& rm /var/lib/dpkg/info/libc-bin.* \
&& apt-get -q clean \
&& apt-get -q update \
# 1. Install runtime dependencies and configure server
RUN apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
dumb-init \
procps \
curl \
lsof \
Comment thread
bitflicker64 marked this conversation as resolved.
Comment thread
bitflicker64 marked this conversation as resolved.
vim \
cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& service cron start \
&& pwd && cd /hugegraph-server/ \
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties

# 2. Init docker script
Expand Down
26 changes: 14 additions & 12 deletions hugegraph-server/Dockerfile-hstore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -15,19 +16,25 @@
# limitations under the License.
#

# Dockerfile for HugeGraph Server
# Dockerfile for HugeGraph Server (hstore backend)
# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY.
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg

# Copy pom files first — layer is only invalidated when pom files change,
# keeping the Maven cache mount warm across source-only changes.
COPY --parents **/pom.xml ./
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
ARG MAVEN_ARGS

RUN mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l && rm \
./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz
COPY . .
RUN --mount=type=cache,target=/root/.m2 \
mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true \
&& rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
FROM eclipse-temurin:11-jre-jammy

COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/
Expand All @@ -41,23 +48,18 @@ LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=50 -XshowSettings:vm" \
HUGEGRAPH_HOME="hugegraph-server"

#COPY . /hugegraph/hugegraph-server
WORKDIR /hugegraph-server/

# 1. Install environment and init HugeGraph Sever
RUN set -x \
&& apt-get -q update \
# 1. Install runtime dependencies and configure server
RUN apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
dumb-init \
procps \
curl \
lsof \
Comment thread
bitflicker64 marked this conversation as resolved.
vim \
cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& service cron start \
&& pwd && cd /hugegraph-server/ \
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties

# 2. Init docker script
Expand Down
26 changes: 13 additions & 13 deletions hugegraph-store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -16,15 +17,21 @@
#

# Dockerfile for HugeGraph Store
# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY.
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg

# Copy pom files first — layer is only invalidated when pom files change,
# keeping the Maven cache mount warm across source-only changes.
COPY --parents **/pom.xml ./
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
Comment thread
bitflicker64 marked this conversation as resolved.
Outdated
ARG MAVEN_ARGS

RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \
./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz
COPY . .
RUN --mount=type=cache,target=/root/.m2 \
mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \
&& rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
Expand All @@ -38,25 +45,18 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max
HUGEGRAPH_HOME="hugegraph-store" \
STDOUT_MODE="true"

#COPY . /hugegraph/hugegraph-store
WORKDIR /hugegraph-store/

# 1. Install environment and init HugeGraph Sever
RUN set -x \
&& rm /var/lib/dpkg/info/libc-bin.* \
&& apt-get -q clean \
&& apt-get -q update \
# 1. Install runtime dependencies
RUN apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
dumb-init \
procps \
curl \
lsof \
vim \
cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& service cron start \
&& pwd && cd /hugegraph-store/
&& rm -rf /var/lib/apt/lists/*

# 2. Init docker script
COPY hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh .
Expand Down
Loading