手动构建starrocks

当我们需要手动构建starrocks,可以采用docker来构建

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
git clone git@github.com:StarRocks/starrocks.git ~/build/starrocks  
##一步一步来  
docker run -it -v /xx/starrocks/.m2:/root/.m2 \   
-v ~/build/starrocks:/root/starrocks \   
--name 3.3.9 -d starrocks/dev-env-ubuntu:latest 
#进入到容器中  
docker exec -it 3.3.9 bash  
#进入到目录  
cd /root/starrocks/  
#执行构建命令  
./build.sh --fe --clean

这里需要注意,3.3.9的景象构建失败了,报错如下:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  16:44 min (Wall Clock)
[INFO] Finished at: 2025-05-15T02:00:52Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project fe-core: Fatal error compiling: error: invalid target release: 17 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :fe-core
root@9f2162a2e6b4:~/starrocks# java -version
openjdk version "11.0.23" 2024-04-16
OpenJDK Runtime Environment (build 11.0.23+9-post-Ubuntu-1ubuntu122.04.1)
OpenJDK 64-Bit Server VM (build 11.0.23+9-post-Ubuntu-1ubuntu122.04.1, mixed mode, sharing)
root@9f2162a2e6b4:~/starrocks# ./build.sh --fe --clean
fatal: detected dubious ownership in repository at '/root/starrocks'

构建完成的jar包在starrocks/output/fe 目录下 image.png

构建自己的景象,可以直接使用升成的jar包来替换景象的

1
2
FROM starrocks/fe-ubuntu:latest  
COPY starrocks-fe.jar /opt/starrocks/fe/lib/

构建命令:

1
docker build -t fe-ubuntu:latest-fix-main .

但是这个尽然不能使用 image.png

然后还是采用默认的本地打包方式吧

DOCKER_BUILDKIT=1 docker build –build-arg ARTIFACT_SOURCE=local –build-arg LOCAL_REPO_PATH=. -f fe-ubuntu.Dockerfile -t fe-ubuntu:main ../../..

构建be景象

1
./build.sh --be --clean

编译时间巨久 image.png image.png

1
DOCKER_BUILDKIT=1 docker build --build-arg ARTIFACT_SOURCE=local --build-arg LOCAL_REPO_PATH=. -f be-ubuntu.Dockerfile -t ghcr.io/starrocks/starrocks/be-ubuntu:main ../../..

image.png

修改景象名称,查看是否可以正常启动,进行测试一下:

1
docker-compose up -d

image.png

image.png

跑一下结果验证一下: image.png

参考链接:

Licensed under CC BY-NC-SA 4.0
最后更新于 May 29, 2025 06:06 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up