Skip to main content
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

📋 Available Tools

The main build script that automatically passes through all build.sh options:

2. docker-dev.sh - Simple Wrapper

Quick commands for common tasks:

3. docker-compose.dev.yml - Docker Compose

For persistent development environments:

🔧 Configuration

Volume Mounts

The Docker scripts automatically mount:
  • Source code: $(pwd):/workspace - Your local repository
  • Maven cache: ~/.m2:/tmp/.m2 - Maven dependencies cache for faster builds
Note: The Maven cache is shared between your host system and the Docker container, so dependencies downloaded during builds are persisted and reused across build sessions.

Environment Variables

Custom Build Options

All original build.sh options are supported:

📁 Output and Artifacts

Build artifacts are created in the output/ directory:
The Docker container mounts your local repository and Maven cache, so all build outputs are available on your host system and dependencies are cached for faster subsequent builds. Multi-User Support: Container names include username and user ID to prevent conflicts on shared development machines (e.g., starrocks-build-username-1001-1234567890). Automatic Extensibility: All unrecognized options are automatically passed through to build.sh, so new build options work without updating the Docker scripts.

🐛 Troubleshooting

Common Issues

  1. Permission Issues
  2. Out of Memory
  3. Docker Image Not Found
  4. Build Failures

Debug Mode

For debugging build issues:

🔍 Verification

Test that everything works:

📊 Performance Tips

  1. Use parallel builds: ./build-in-docker.sh --be -j $(nproc)
  2. Maven cache: Automatically mounted from ~/.m2 for faster dependency resolution
  3. Memory allocation: Increase Docker memory limit for faster builds
  4. SSD storage: Use SSD for Docker storage driver
  5. Persistent volumes: Use Docker Compose for additional cache persistence

🤝 Integration with IDEs

VS Code with Dev Containers

Create .devcontainer/devcontainer.json:

IntelliJ IDEA

Use the Docker integration to run builds and tests within the container environment.

📚 Additional Resources

🆘 Support

If you encounter issues:
  1. Check the troubleshooting section above
  2. Verify Docker setup and image availability
  3. Try clean builds with --clean flag
  4. Open an issue with build logs and system information