Run Claude Code in Docker
Running Claude Code in Docker provides isolation, reproducibility, and team consistency. SCC CLI makes this straightforward.
Why Docker for Claude Code
Section titled “Why Docker for Claude Code”| Benefit | What It Means |
|---|---|
| Isolation | AI execution separated from host system |
| Reproducibility | Same environment across all team members |
| Clean state | Each session starts fresh (or can resume) |
| Controlled access | Only mounted directories are visible |
Prerequisites
Section titled “Prerequisites”# Docker Desktop 4.50+brew install --cask docker
# Start Docker Desktop and ensure engine is running
# Python 3.10+brew install python@3.12
# Git 2.30+brew install git# Docker Desktop 4.50+winget install Docker.DockerDesktop
# Start Docker Desktop and ensure engine is running
# Python 3.10+winget install Python.Python.3.12
# Git 2.30+winget install Git.Git# Docker Engine or Docker Desktop# Follow Docker's official installation guide for your distro
# Python 3.10+sudo apt install python3.12 # Debian/Ubuntu
# Git 2.30+sudo apt install gitQuick Start
Section titled “Quick Start”# Install SCC CLIuv tool install scc-cli
# Configure SCC (one-time setup)scc setup
# Start Claude Code in Dockerscc start ~/your-projectThat’s it. Claude Code now runs inside a Docker container with your project mounted.
How It Works
Section titled “How It Works”When you run scc start, SCC:
- Creates a container based on configured image
- Mounts your workspace at a controlled path
- Applies team configuration (plugins, policies)
- Starts Claude Code inside the container
- Manages the session (resume, stop, cleanup)
┌─────────────────────────────────────┐│ Your Machine ││ ││ ~/your-project ││ │ ││ ▼ (mounted read-write) ││ ┌─────────────────────────────┐ ││ │ Docker Container │ ││ │ /workspace/your-project │ ││ │ │ ││ │ Claude Code runs here │ ││ │ + Team plugins │ ││ │ + Safety Net │ ││ │ + Network policies │ ││ └─────────────────────────────┘ │└─────────────────────────────────────┘Configuration Options
Section titled “Configuration Options”Workspace Mounting
Section titled “Workspace Mounting”By default, SCC mounts the directory you specify:
scc start ~/projects/my-app # Mounts ~/projects/my-appTeam Profiles
Section titled “Team Profiles”If your organization has profiles configured:
scc start --team backend ~/project # Use backend team profilescc start --team frontend ~/project # Use frontend team profileSession Management
Section titled “Session Management”# List active sessionsscc session list
# Resume a previous sessionscc start --resume ~/project
# Stop a sessionscc session stop <session-id>Docker Requirements
Section titled “Docker Requirements”SCC requires:
- Docker Desktop 4.50+ (macOS, Windows) or Docker Engine (Linux)
- Docker Engine running when you use SCC
- Sufficient disk space for container images
Verifying Docker Setup
Section titled “Verifying Docker Setup”# Check Docker is runningdocker info
# Check Docker versiondocker --version
# Verify SCC can access Dockerscc doctorTroubleshooting
Section titled “Troubleshooting”Docker Not Running
Section titled “Docker Not Running”Error: Cannot connect to Docker daemonStart Docker Desktop or Docker Engine, then retry.
Permission Issues
Section titled “Permission Issues”Error: Permission denied while trying to connect to Docker daemonOn Linux, add your user to the docker group:
sudo usermod -aG docker $USER# Log out and back inImage Pull Failures
Section titled “Image Pull Failures”Error: Failed to pull imageCheck network connectivity and Docker Hub access. For air-gapped environments, pre-pull images or configure a local registry.
Advanced Usage
Section titled “Advanced Usage”Dry Run
Section titled “Dry Run”Preview what would happen without actually starting:
scc start --dry-run ~/projectJSON Output
Section titled “JSON Output”Get machine-readable output for scripting:
scc start --dry-run --json ~/projectCustom Network Policy
Section titled “Custom Network Policy”Network policies are configured at the org/team level:
{ "defaults": { "network_policy": "isolated" }}Next Steps
Section titled “Next Steps” Quick Start Complete installation guide
Security Model Understand isolation layers
Troubleshooting Docker Solve Docker-related issues