[Improve] Docker build image from source code slowly

Open
#2,363 0 comments 1 reaction 0 assignees View on GitHub

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

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
Bug Type (问题类型)

None

Before submit
  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (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
<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>
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/hugegraph

All issues in apache/hugegraph

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.