[Improve] Docker build image from source code slowly
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, java
- Domain
- build-system, devops
Research direction
Start with hugegraph-server/Dockerfile and run the reported docker build command to measure the first-stage dependency download. Compare that flow with computer-k8s-operator/Dockerfile and inspect the project build configuration for the proposed repository or local-artifact approaches. Done means the documented source build completes faster without changing the resulting image.
Written by the indexing model from the issue text.
Description
Bug Type (问题类型)
None
Before submit
- 我已经确认现有的 Issues 与 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.add aliyun repo in the pom
<repositories>
<repository>
<id>aliyun</id>
<url>https://maven.aliyun.com/repository/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun</id>
<url>https://maven.aliyun.com/repository/public</url>
</pluginRepository>
</pluginRepositories>
- 2.like hugegraph-computer 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
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 637
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/hugegraph
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
All issues in apache/hugegraph
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100