This document contains all architecture and building instructions for the Claude Code Docker image.
Dockerfile: Defines the Docker image with Node.js and necessary dependencies for running Claude Code- Uses node:20-slim as base image
- Installs required system packages
- Installs Python and pip for code-index-mcp dependency
- Sets up environment for Claude Code
- Shell scripts for building, running, and publishing the Docker image:
docker-build.sh: Builds the Docker image locallydocker-run-local.sh: Runs Claude Code in the Docker containerdocker-push.sh: Pushes the Docker image to Docker Hub
First copy the .env-template to .env and edit with your info:
cp .env-template .envYou can configure the following environment variables:
IGD_UTILS_DOCKER_IMG: Docker image name (default: idachev-claude-code)IGD_UTILS_DOCKER_TAG: Docker image tag (default: latest)
Build with a single tag:
./docker-build.shBuild with multiple tags (e.g., version and latest):
./docker-build.sh 0.2.0 latestThis will build the image with the first tag (0.2.0) and then tag it with the second tag (latest).
./docker-run-local.shYou can set a custom location for Claude configuration files:
CLAUDE_CODE_HOME=/path/to/custom/dir ./docker-run-local.shPush with a single tag:
./docker-push.shPush with multiple tags (e.g., version and latest):
./docker-push.sh 0.2.0 latestThis will tag and push both versions to the remote registry.
The Docker image includes:
- Node.js 20 (slim version)
- Python 3 and pip for code-index-mcp
- Git, zsh, ripgrep and other development tools
- The Claude Code CLI tool
Important implementation notes:
- The Docker image switches between root and node users for different installation steps
- The final image uses the node user for security best practices
- Apt cache is cleaned up after all apt commands to reduce image size