|
| 1 | +# Quick Start Guide - Docker Setup |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +```bash |
| 6 | +# Build dev image (faster - just installs tools) |
| 7 | +docker build -f Dockerfile.dev -t roxy-dev . |
| 8 | + |
| 9 | +# Run with volume mounting (instant rebuilds) |
| 10 | +docker run -it --rm \ |
| 11 | + -v $(pwd):/app \ |
| 12 | + -v cargo-cache:/usr/local/cargo/registry \ |
| 13 | + -v target-cache:/app/target \ |
| 14 | + roxy-dev bash |
| 15 | + |
| 16 | +# Inside container, build and test |
| 17 | +cargo build |
| 18 | +cargo test |
| 19 | +``` |
| 20 | + |
| 21 | +## Using Docker Compose (Easiest) |
| 22 | + |
| 23 | +```bash |
| 24 | +# Start development container (uses volumes - no rebuild needed) |
| 25 | +docker-compose up -d roxy-dev |
| 26 | + |
| 27 | +# Access container shell |
| 28 | +docker-compose exec roxy-dev bash |
| 29 | + |
| 30 | +# Build inside container (uses cached volumes) |
| 31 | +cargo build --release |
| 32 | +``` |
| 33 | +# Access the container shell |
| 34 | +```bash |
| 35 | +docker-compose exec roxy-dev bash |
| 36 | +``` |
| 37 | + |
| 38 | +# Or run commands directly |
| 39 | +```bash |
| 40 | +docker-compose exec roxy-dev cargo build |
| 41 | +docker-compose exec roxy-dev cargo test |
| 42 | +docker-compose exec roxy-dev cargo check |
| 43 | +``` |
| 44 | + |
| 45 | +# Stop containers |
| 46 | +```bash |
| 47 | +docker-compose down |
| 48 | +``` |
| 49 | + |
| 50 | +# Start again |
| 51 | +```bash |
| 52 | +docker-compose up -d roxy-dev |
| 53 | +``` |
| 54 | + |
| 55 | +## Memory Issues? (Linker Killed) |
| 56 | + |
| 57 | +If you see `ld terminated with signal 9 [Killed]`, it's an out-of-memory issue. |
| 58 | + |
| 59 | +**Quick Fix:** |
| 60 | +```bash |
| 61 | +# Run tests with single job (uses less memory) |
| 62 | +docker-compose exec roxy-dev cargo test --jobs 1 |
| 63 | + |
| 64 | +# Or build in release mode (uses less memory) |
| 65 | +docker-compose exec roxy-dev cargo test --release --jobs 1 |
| 66 | +``` |
| 67 | + |
| 68 | +**Better Solution:** Increase Docker Desktop memory limit: |
| 69 | +1. Docker Desktop → Settings → Resources → Advanced |
| 70 | +2. Increase Memory to 4GB+ (recommended: 6-8GB) |
| 71 | +3. Apply & Restart |
| 72 | + |
| 73 | +See `DOCKER_TROUBLESHOOTING.md` for more solutions. |
| 74 | + |
0 commit comments