This topic describes how to compile StarRocks using Docker.
OverviewâStarRocks provides development environment images for both Ubuntu 22.04 and CentOS 7.9. With the image, you can launch a Docker container and compile StarRocks in the container.
StarRocks version and DEV ENV imageâDifferent branches of StarRocks correspond to different development environment images provided on StarRocks Docker Hub.
For Ubuntu 22.04:
Branch name Image name main starrocks/dev-env-ubuntu:latest branch-3.5 starrocks/dev-env-ubuntu:3.5-latest branch-3.4 starrocks/dev-env-ubuntu:3.4-latest branch-3.3 starrocks/dev-env-ubuntu:3.3-latest branch-3.2 starrocks/dev-env-ubuntu:3.2-latest branch-3.1 starrocks/dev-env-ubuntu:3.1-latest branch-3.0 starrocks/dev-env-ubuntu:3.0-latest branch-2.5 starrocks/dev-env-ubuntu:2.5-latestFor CentOS 7.9:
Branch name Image name main starrocks/dev-env-centos7:latest branch-3.5 starrocks/dev-env-centos7:3.5-latest branch-3.4 starrocks/dev-env-centos7:3.4-latest branch-3.3 starrocks/dev-env-centos7:3.3-latest branch-3.2 starrocks/dev-env-centos7:3.2-latest branch-3.1 starrocks/dev-env-centos7:3.1-latest branch-3.0 starrocks/dev-env-centos7:3.0-latest branch-2.5 starrocks/dev-env-centos7:2.5-latestBefore compiling StarRocks, make sure the following requirements are satisfied:
Hardware
Your machine must have at least 8 GB RAM.
Software
Download the development environment image by running the following command:
Docker automatically identifies the CPU architecture of your machine and pulls the corresponding image that suits your machine. The linux/amd64
images are for the x86-based CPUs, and linux/arm64
images are for the ARM-based CPUs.
You can launch the development environment Docker container with or without the local host path mounted. We recommend you launch the container with the local host path mounted, so that you can avoid re-downloading the Java dependency during the next compilation, and you do not need to manually copy the binary files from the container to your local host.
Launch the container with the local host path mounted:
Clone the StarRocks source code to your local host.
git clone https://github.com/StarRocks/starrocks.git
Launch the container.
docker run -it -v <code_dir>/.m2:/root/.m2 \
-v <code_dir>/starrocks:/root/starrocks \
--name <branch_name> -d <image_name>
Launch a bash shell inside the container you have launched.
docker exec -it <branch_name> /bin/bash
Compile StarRocks in the container.
cd /root/starrocks && ./build.sh
Launch the container without the local host path mounted:
Launch the container.
docker run -it --name <branch_name> -d <image_name>
Launch a bash shell inside the container.
docker exec -it <branch_name> /bin/bash
Clone the StarRocks source code to the container.
git clone https://github.com/StarRocks/starrocks.git
Compile StarRocks in the container.
cd starrocks && ./build.sh
Q: The StarRocks BE building fails, and the following error message has been returned:
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
What should I do?
A: This error message indicates a lack of memory in the Docker container. You need to allocate at least 8 GB of memory resources to the container.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4