Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.

# Version-control and local development metadata
.git
.github
.idea
.vscode
.codex-task
**/.DS_Store

# Build outputs and dependency caches
**/target
**/node_modules
**/.cache

# Modules not used by the Hubble image build. Keep the Maven module POMs so
# the root reactor can still be parsed, and keep release docs used by hubble-dist.
hugegraph-client-go
hugegraph-spark-connector/**
!hugegraph-spark-connector/pom.xml
hugegraph-tools/**
!hugegraph-tools/pom.xml
hugegraph-dist/**
!hugegraph-dist/pom.xml
!hugegraph-dist/release-docs/
!hugegraph-dist/release-docs/**
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,28 @@ docker run --rm \
Build images locally:
```bash
# Loader
cd hugegraph-loader && docker build -t hugegraph/hugegraph-loader:latest .
docker build -f hugegraph-loader/Dockerfile \
-t hugegraph/hugegraph-loader:latest .

# Hubble
cd hugegraph-hubble && docker build -t hugegraph/hugegraph-hubble:latest .
docker build -f hugegraph-hubble/Dockerfile \
-t hugegraph/hugegraph-hubble:latest .
```

Multi-platform builds use BuildKit's automatic platform arguments. The Maven
and Node build stages run on `$BUILDPLATFORM`, while the final JRE stage uses
`$TARGETPLATFORM`. Java bytecode and frontend assets are architecture-neutral,
so they are built once without QEMU. Target-stage package installation still
runs for each architecture.

This optimization applies only to architecture-independent build outputs. A
component that compiles native code must use a target-platform build stage or
separate platform stages. Loader and Hubble packaging is validated on arm64;
native dependencies must still be audited. Loader includes arm64 variants for
Snappy, LZ4, Commons Crypto, and gRPC tcnative. Some optional legacy HBase and
Jansi natives remain x86-only, so their fallback paths require target-runtime
validation when those optional features are used.

## Documentation

- [HugeGraph Toolchain Overview](https://hugegraph.apache.org/docs/quickstart/)
Expand Down
5 changes: 3 additions & 2 deletions hugegraph-hubble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
# limitations under the License.
#

FROM maven:3.9.0-eclipse-temurin-11 AS build
FROM --platform=$BUILDPLATFORM maven:3.9.0-eclipse-temurin-11 AS build

ENV NODE_OPTIONS=--dns-result-order=ipv4first

ARG MAVEN_ARGS

COPY . /pkg
WORKDIR /pkg

RUN set -x \
Expand All @@ -30,6 +29,8 @@ RUN set -x \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . /pkg

RUN set -x \
&& mvn install $MAVEN_ARGS -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp \
&& cd /pkg/hugegraph-hubble/ \
Expand Down
16 changes: 6 additions & 10 deletions hugegraph-loader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,19 @@
# limitations under the License.
#

FROM maven:3.9.0-eclipse-temurin-11 AS build
FROM --platform=$BUILDPLATFORM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg

ARG MAVEN_ARGS

RUN set -x \
&& mvn install $MAVEN_ARGS -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp

RUN set -x \
&& cd /pkg/hugegraph-loader/ \
&& echo "$(ls)" \
&& mvn clean package $MAVEN_ARGS -DskipTests
&& mvn clean package $MAVEN_ARGS -pl hugegraph-client,hugegraph-loader -am \
-Dmaven.javadoc.skip=true -DskipTests -ntp

FROM eclipse-temurin:11-jre-jammy

COPY --from=build /pkg/hugegraph-loader/apache-hugegraph-loader-*/ /loader
WORKDIR /loader/

RUN set -x \
&& apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
Expand All @@ -45,6 +38,9 @@ RUN set -x \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /pkg/hugegraph-loader/apache-hugegraph-loader-*/ /loader
WORKDIR /loader/

VOLUME /loader

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
Expand Down
Loading