apache / apache/hugegraph

[Improve] Docker build image from source code slowly

Open
#2,363 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

None

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

- Server Version: 1.2.0
- OS: mac

### Expected & Actual behavior (期望与实际表现)

**build image from source code:**
```
docker build -t hugegraph/apache-hugegraph-server-incubating-1.2.0:latest . -f hugegraph-server/Dockerfile

```

Dockerfile 1st stage
```
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build

COPY . /pkg
WORKDIR /pkg
RUN mvn package -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l
```
the 1st stage mvn package should download from repo. it's slowly.

**I think there is tow way to speed up downloading dependencies:**

1. 1.add aliyun repo in the pom

```


aliyun
https://maven.aliyun.com/repository/public



aliyun
https://maven.aliyun.com/repository/public


```

2. 2.like hugegraph-computer [Dockerfile](https://github.com/apache/incubator-hugegraph-computer/blob/master/computer-k8s-operator/Dockerfile)

build tar on local env then copy the jar to the docker image.

The advantage is that you can use a local proxy to speed up downloading dependencies

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.