StarForge provides Docker and Docker Compose configurations for reproducible development and testing environments.
- Docker 20.10+
- Docker Compose 2.0+ (for multi-container workflows)
Execute a single command:
docker run --rm ghcr.io/nanle-code/starforge:latest <command>Example: Get version
docker run --rm ghcr.io/nanle-code/starforge:latest --versionExample: Deploy a contract
docker run --rm -v $(pwd):/workspace ghcr.io/nanle-code/starforge:latest deploy --wasm ./contract.wasm --network testnetBuild production image:
docker build -t starforge:local .Build development image:
docker build -f Dockerfile.dev -t starforge:dev .Docker Compose sets up StarForge with a local Stellar + Soroban environment.
Start all services:
docker-compose up -dThis brings up:
stellar-testnet: Local Stellar/Soroban instance onhttp://localhost:8000soroban-rpc: Dedicated Soroban RPC onhttp://localhost:8001starforge: Development container with live editing
Run commands:
# Execute a command in the starforge container
docker-compose run --rm starforge starforge deploy --wasm ./token.wasm --network docker-testnet
# Interactive shell
docker-compose run --rm starforge bash
# Live development (edits to code auto-reload)
docker-compose run --rm starforge cargo run -- <command>Stop services:
docker-compose down-
Start containers:
docker-compose up -d
-
Edit code (changes reflect immediately due to volume mount)
-
Test in container:
docker-compose run --rm starforge cargo test -
Debug with hot-reload:
docker-compose run --rm starforge cargo run -- wallet list
-
Stop when done:
docker-compose down
- Size: ~100MB (optimized with multi-stage build)
- Base:
debian:bookworm-slim - Includes: Binary only, Stellar CLI
- Use case: Running deployed versions, CI/CD pipelines
- Command:
starforge <args>(default entrypoint)
- Size: ~2GB (includes Rust toolchain)
- Base:
rust:1-bookworm - Includes: Full build environment, cargo
- Use case: Development, testing, contributions
- Command:
cargo run -- <args>
All StarForge environment variables are supported in containers:
# Example with custom RPC URL
docker run \
-e STELLAR_RPC_URL=http://soroban-rpc:8000 \
-e STELLAR_NETWORK=local \
starforge:local deploy --wasm ./contract.wasmdocker-compose run --rm starforge \
starforge deploy \
--wasm ./target/wasm32-unknown-unknown/release/contract.wasm \
--network docker-testnetdocker-compose run --rm starforge cargo test --lockeddocker-compose run --rm starforge \
starforge plugin create my-plugin# Note: USB passthrough required
docker run \
--device /dev/bus/usb \
-e STELLAR_HARDWARE_WALLET=ledger \
starforge:local wallet import --hardware ledgerEnsure you're connected to the internet. The Dockerfile installs Stellar CLI via a remote script.
Volume cargo-cache is defined in docker-compose.yml for cache persistence. Clean it if needed:
docker volume rm starforge_cargo-cacheUse --user flag when needed:
docker-compose run --rm --user root starforge bashServices communicate via hostnames defined in docker-compose.yml:
- StarForge → Soroban RPC:
http://soroban-rpc:8000 - Soroban RPC → Stellar: Uses internal Stellar quickstart networking
Check logs:
docker-compose logs starforge- Use
--rmflag: Automatically removes containers after execution - Mount volumes correctly:
-v $(pwd):/workspaceensures file access - Use
docker-compose: Provides consistent multi-container environment - Cache dependencies: Dev image pre-builds dependencies to speed up iterations
- Pin versions: Use specific image tags in production (avoid
:latest)
When contributing, use the development image and Docker Compose:
# Build from your branch
docker build -f Dockerfile.dev -t starforge:dev-branch .
# Test changes
docker-compose run --rm starforge cargo test
# Run linter and formatter checks
docker-compose run --rm starforge cargo fmt --all --check
docker-compose run --rm starforge cargo clippy --locked- DEVELOPER_GUIDE.md - Full development setup
- README.md - General project information
- docker-compose.yml - Service configuration