A modern DevContainer setup using Podman with sidecar containers for building (Rust, Geant4, etc.) without bloating your dev environment.
# Clone the repository
git clone <repo-url>
cd devc-sidecar-tests
# Run the install script (installs just and checks dependencies)
./install.sh# Edit your personal Git config
nano .devcontainer/.config/git/host
# Set: user.name and user.email# Build containers
just containers-build
# Start development environment
just startcode .
# Then: Command Palette β "Dev Containers: Reopen in Container"- π Python 3.11 development environment (slim)
- π¦ Rust builder sidecar (build without installing Rust locally)
- π¬ Geant4 sidecar example (heavy simulation tools isolated)
- π SSH commit signing (via agent forwarding, no keys in container)
- π GitHub CLI (gh) pre-configured
- β‘ Modern CLI tools (ripgrep, fd, bat, eza, yq, jq)
- π uv for blazing fast Python package management
- π just as single entry point for all commands
Main Container (slim) Builder Sidecars (isolated)
βββββββββββββββββββ ββββββββββββββββ¬βββββββββββββββ
β β β β β
β Python Dev βββββββΊβ Rust Builder β Geant4 β
β + Tools β sock β ~2GB β Builder β
β + Editor β exec β β ~3GB β
β ~500MB β β β β
β β β β β
βββββββββββββββββββ ββββββββββββββββ΄βββββββββββββββ
β β
βββββββββββββββββββββββββββ
Shared volumes + network
Communication: Docker-out-of-Docker (DooD) pattern - industry standard used by GitLab CI, GitHub Actions, Jenkins
Key Benefits:
- β Dev container stays slim (~500MB vs ~5GB+)
- β Build tools isolated in sidecars
- β No private keys in containers (SSH agent forwarding)
- β Fast rebuilds with caching
- β Multi-architecture support (Intel + Apple Silicon)
- β Standard Docker socket communication (industry best practice)
New! The justfile is now modular for better organization. Run just init for interactive setup.
All commands use just as the entry point:
# Setup & Help
just init # Interactive workspace setup
just init-quick # Quick init with defaults (non-interactive)
just init-list # List all modules and their status
just # List all commands
just help-modules # Explain modular justfile system
just show-config # Show current configuration
# Workspace
just init-workspace # Check dependencies & config
just check-deps # Verify all tools installed
# Setup (one-time)
just setup # Setup Git, GitHub CLI, signing
just setup-git-config # Load Git configs
just setup-gh-config # Load GitHub CLI config
just setup-signing # Configure SSH commit signing
# Containers
just containers-build # Build with cache (fast)
just containers-build-clean # Clean build
just start # Start all containers
just stop # Stop all containers
just restart # Rebuild and restart
just ps # Show running containers
# Development
just install # Install Python dependencies
just py-add requests # Add Python package
just rust-build # Build Rust project
just test # Run tests
# CI Simulation (test prod builds locally!)
just build-prod # Build production image
just test-prod # Test production image
just ci-simulate # Quick CI simulation
just ci-full # Full CI pipeline simulation
just scan-prod # Security vulnerability scan
just compare-images # Compare dev vs prod sizes
# Performance Testing
just bench # Run benchmarks (measure speed)
# Documentation
just docs # Build and serve documentation
just docs-build # Build documentation
just docs-serve # Serve docs locally on port 8000
just docs-list # List all markdown files
just docs-spell # Spell check documentation
# Git & GitHub
just status # git status
just ac "message" # Add, commit, push
just gh-pr # Create pull request
just gh-status # Check GitHub auth
# Utilities
just versions # Show tool versions
just logs app # View container logs
just shell app # Shell into container
just prune # Clean up unused images.
βββ install.sh # Bootstrap script
βββ justfile # Command definitions
βββ main.py # Your Python code
βββ pyproject.toml # Python project config
β
βββ .devcontainer/
β βββ Dockerfile # Main container definition
β βββ docker-compose.yml # Multi-container setup
β βββ devcontainer.json # VS Code config
β β
β βββ .config/
β β βββ git/
β β β βββ config # Team Git config (committed)
β β β βββ host.example # Template (committed)
β β β βββ host # Personal config (gitignored)
β β βββ gh/
β β βββ config.yml # Team GitHub CLI config (committed)
β β βββ hosts.example.yml # Reference (committed)
β β
β βββ geant4-example/ # Example Geant4 sidecar setup
β β
β βββ docs/
β βββ ARCHITECTURE.md # Architecture overview
β βββ CONTAINERS.md # Container build guide
β βββ MULTIARCH.md # Multi-arch support
β βββ SECURITY.md # Security model
β βββ SIGNING.md # Commit signing guide
β βββ PODMAN.md # Podman usage
β βββ GIT.md # Git commands
β βββ GH.md # GitHub CLI
β βββ UV.md # uv package manager
β βββ TOOLS.md # CLI tools reference
β βββ JUSTFILE_MODULES.md # Modular justfile system
β βββ BENCHMARKING_GUIDE.md # Performance testing guide
β
βββ .gitignore # Git ignore rules
- Podman 3.0+ (with compose support)
- Git 2.0+
- just (installed by install.sh)
- SSH (for git authentication)
- VS Code (optional, for devcontainer)
All checked by just check-deps.
Git (.devcontainer/.config/git/config):
- Commit signing required
- SSH format
- Default branch: main
- Useful aliases
GitHub CLI (.devcontainer/.config/gh/config.yml):
- Git protocol: SSH
- Useful aliases (co, pv, pl, etc.)
Git (.devcontainer/.config/git/host):
- Your name and email
- Signing key (optional)
- Personal preferences
Created from template on first run.
- π Private keys NEVER enter containers
- π SSH agent forwarding from host (via VS Code)
- π Only public keys visible in containers
- β Container compromise = no key theft
- Git operations: SSH agent (forwarded from host)
- Commit signing: SSH signing (via agent)
- GitHub API:
gh auth login(token in~/.config/gh/)
See .devcontainer/SECURITY.md for complete security model.
Works natively on:
- β x86_64 (Intel/AMD)
- β ARM64 (Apple Silicon M1/M2/M3/M4, AWS Graviton)
Auto-detects architecture and downloads correct binaries.
Instead of:
β One huge container with everything
- Python + Rust + Geant4 + tools
- 5GB+, slow to build, bloated
We use:
β
Slim dev container + builder sidecars
- Dev: 500MB (fast, focused)
- Builders: Isolated, cacheable
- Total: Same size but organized
Rust example:
# Build in sidecar (transparent)
just rust-build
# Or directly
just cargo build --release
# The cargo wrapper uses the sidecar automaticallyGeant4 example:
# Build simulation in sidecar
just g4-build
# Run in runtime sidecar
just g4-run ./build/simulationSee .devcontainer/geant4-example/ for complete Geant4 setup.
# Check Podman version (needs 3.0+)
podman version
# Test compose
podman compose version# On host, add your key
ssh-add ~/.ssh/id_ed25519
# Verify
ssh-add -l
# Restart VS Code/container# Check logs
just logs app
# Check Podman
podman ps -a
# Clean rebuild
just stop
just containers-build-clean
just start# Should auto-detect, but verify
uname -m # Should show arm64 or aarch64
# Clean build
just containers-build-cleanComprehensive docs in .devcontainer/:
- DEV_TO_PROD_WORKFLOW.md β - Complete dev β staging β prod guide
- JUSTFILE_MODULES.md β - Modular justfile system explained
- ARCHITECTURE.md - How everything fits together
- SIDECAR_COMMUNICATION.md - How sidecars communicate (DooD pattern)
- CONTAINERS.md - Container build optimization
- MULTIARCH.md - Multi-architecture support
- SECURITY.md - Security model and best practices
- SIGNING.md - SSH commit signing setup
- PODMAN.md - Podman usage and tips
- GIT.md - Git commands and workflows
- GH.md - GitHub CLI usage
- UV.md - uv package manager guide
- TOOLS.md - Modern CLI tools reference
- TROUBLESHOOTING_SIDECARS.md - Sidecar connectivity issues
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes
- Commit with signing:
git commit -s -m "Add feature" - Push:
git push origin feature-name - Create PR:
just gh-pr
[Your License Here]
Built with:
- Podman - Container engine
- just - Command runner
- uv - Python package manager
- GitHub CLI - GitHub automation
- Modern CLI tools (ripgrep, fd, bat, eza, yq)
- π Documentation:
.devcontainer/directory - π Issues: [GitHub Issues]
- π¬ Discussions: [GitHub Discussions]