A Docker-based development environment for using Claude Code CLI.
This repository contains Docker configuration for creating a development environment with Claude Code CLI pre-installed and ready to use.
- Ubuntu-based environment with Node.js 20.x
- Claude Code CLI pre-installed globally
- GitHub CLI (gh) for GitHub integration
- SSH server configured for remote access
- Common development tools: git, vim, nano, etc.
- Persistent volume for your code repositories
For detached mode (background):
docker compose up -d
For interactive mode with a shell:
docker compose up
The container provides two ways to access it:
- Interactive shell when starting the container directly:
docker compose run --rm claude-code
- SSH access from your host machine or remotely:
ssh -p 2222 ubuntu@localhost
You can also override the default behavior to run specific commands:
docker compose run claude-code custom-command
Once connected to the container, you can use Claude Code with simple commands:
# Start interactive session
claude
# Ask a question about your code
claude "explain this project"
# Fix code issues
claude "fix the type errors in auth.js"
# Review and commit changes
claude commit
# Process a file
cat file.js | claude "refactor this code"
You can configure the environment by:
- Copying
.env.example
to.env
and modifying it:
cp .env.example .env
- Editing the
.env
file with your preferred settings:
ANTHROPIC_API_KEY=your_api_key_here
The Docker environment supports several volume mounts:
- Code Repositories: Maps to
/home/ubuntu/repos
for persistent storage of your code - SSH Keys: Optionally mount your local SSH keys for GitHub access
- Claude Configuration: Optionally mount your Claude/Anthropic configuration
Edit docker-compose.yaml
to customize these mounts for your environment.
MIT