Setup development environment with Docker
This directory provides Docker-based build tools for StarRocks that use the official starrocks/dev-env-ubuntu:latest development environment image. This ensures consistent builds across different host systems by using a standardized Ubuntu environment with all required toolchains and dependencies pre-installed.
🚀 Quick Start
Prerequisites
- Docker installed and running
- At least 8GB RAM available for Docker
- At least 20GB free disk space
Simple Commands
# Open development shell
./docker-dev.sh shell
# Build Frontend only
./docker-dev.sh build-fe
# Build Backend only
./docker-dev.sh build-be
# Build everything
./docker-dev.sh build-all
# Clean build everything
./docker-dev.sh clean-build
# Run Frontend tests
./docker-dev.sh test-fe
📋 Available Tools
1. build-in-docker.sh - Full-Featured Build Script
The main build script that automatically passes through all build.sh options:
# Basic usage
./build-in-docker.sh # Build all (FE + BE)
./build-in-docker.sh --fe # Build Frontend only
./build-in-docker.sh --be # Build Backend only
./build-in-docker.sh --fe --be --clean # Clean and build both
# Advanced options
./build-in-docker.sh --be --with-gcov # Build BE with code coverage
./build-in-docker.sh --fe --disable-java-check-style # Skip checkstyle
./build-in-docker.sh --be -j 8 # Build with 8 parallel jobs
# Development
./build-in-docker.sh --shell # Interactive shell
./build-in-docker.sh --test # Build and run tests
# Custom image
./build-in-docker.sh --image starrocks/dev-env-ubuntu:latest --fe
# Future build.sh options work automatically
./build-in-docker.sh --be --new-future-option
2. docker-dev.sh - Simple Wrapper
Quick commands for common tasks:
./docker-dev.sh shell # Development shell
./docker-dev.sh build-fe # Build Frontend
./docker-dev.sh build-be # Build Backend
./docker-dev.sh build-all # Build everything
./docker-dev.sh clean-build # Clean and build all
./docker-dev.sh test-fe # Run FE tests
./docker-dev.sh test-be # Run BE tests
./docker-dev.sh test-all # Run all tests
# Pass through any build.sh options
./docker-dev.sh build --be --with-gcov
./docker-dev.sh build --fe --new-option
3. docker-compose.dev.yml - Docker Compose
For persistent development environments:
# Start development shell
docker-compose -f docker-compose.dev.yml run --rm starrocks-dev
# Build Frontend
docker-compose -f docker-compose.dev.yml run --rm build-fe
# Build Backend
docker-compose -f docker-compose.dev.yml run --rm build-be
# Run tests
docker-compose -f docker-compose.dev.yml run --rm test-fe
docker-compose -f docker-compose.dev.yml run --rm test-be
# Clean up
docker-compose -f docker-compose.dev.yml down -v