A Docker image for Claude Code that allows you to run Claude Code in a container environment.
- Based on Node.js 22.11.0
- Pre-installed with @anthropic-ai/claude-code
- Multi-platform support (linux/amd64, linux/arm64)
- Set environment variables:
GITHUB_TOKEN=your_github_token
GITHUB_ID=your_github_id
- Start the container:
docker compose up --build
docker run --rm -it \
-e GITHUB_TOKEN \
-w `pwd` \
-v `pwd`:`pwd` \
-v claude-code-docker-node-versions:/home/appuser/.nodenv/versions \
ghcr.io/gendosu/claude-code-docker:latest
Add the following configuration to your Claude Desktop config file (claude_desktop_config.json
) to use the Claude Code feature:
{
"mcpServers": {
"claude-code": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GITHUB_TOKEN",
"-w",
"/path/to/your/workspace",
"-v",
"/path/to/your/workspace:/path/to/your/workspace",
"-v",
"claude-code-docker-node-versions:/home/appuser/.nodenv/versions",
"ghcr.io/gendosu/claude-code-docker:latest",
"mcp",
"serve"
],
"env": {
"NODENV_VERSION": "22.11.0",
"GITHUB_TOKEN": "<Your GitHub Token>"
}
}
}
}
Configuration details:
command
: Specify the Docker commandargs
:-w
: Specify the working directory-v
: Specify volume mount between host and containermcp serve
: Start the Claude Code MCP server
Note: This configuration is specific to Claude Desktop. VSCode requires a different configuration method.
This image is available on GitHub Container Registry:
docker pull ghcr.io/gendosu/claude-code-docker:latest
MIT
gendosu