Skip to content

A lightweight, dependency-free way to run Claude Code CLI using Docker — no need for node, npm, or global installations.

Notifications You must be signed in to change notification settings

kristijansoldo/claude-code-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 Claude Code Docker Wrapper

A lightweight, dependency-free way to run Claude Code CLI using Docker — no need for node, npm, or global installations.

✅ Ideal for developers who prefer not to pollute their local environment with NodeJS-based dependencies.


🚀 Features

  • Run Claude CLI in any project folder using run-claude
  • Works on Linux, macOS, WSL, or any system with Docker
  • CLI login and API session are persisted across runs
  • Mounts current directory into the container for context-aware use

🧱 Prerequisites

  • Docker installed
  • Bash shell (bash, zsh, or similar)

🔧 Installation

git clone https://github.com/kristijansoldo/claude-code-docker.git
cd claude-code-docker
chmod +x install.sh run-claude.sh
./install.sh

This will create a global run-claude command available from any directory.


🛠️ First-time setup

After installation:

cd /path/to/your/project
run-claude

Inside the container:

claude login

Your login will be stored locally in ~/.claude and reused for future sessions.


🧪 Example usage

From any project folder:

run-claude

Then:

claude ask "What does this repo do?"

Claude will analyze your mounted code and answer contextually.


🔁 Rebuilding the Docker image

If you ever need to rebuild the image (e.g. after modifying the Dockerfile):

docker build -t claude-code-cli .

📁 Folder Structure

claude-code-docker/
├── Dockerfile         # Defines the Node environment and installs Claude CLI
├── install.sh         # Installs 'run-claude' globally via symlink
├── run-claude.sh      # Main script that launches Claude CLI container
└── README.md

🧹 Uninstall (optional)

If you want to remove everything:

sudo rm /usr/local/bin/run-claude
docker rmi claude-code-cli
rm -rf ~/.claude ~/.claude.json

About

A lightweight, dependency-free way to run Claude Code CLI using Docker — no need for node, npm, or global installations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published