Sign inSign up

muritiku/local_claude

By muritiku

•Updated 6 months ago

This image aims to containerize Claude Code, supporting full air-gapped (offline) functionality.

Image
Machine learning & AI
Developer tools
1

1.4K

muritiku/local_claude repository overview

⁠Claude Code Local Docker Image

This image containerizes Claude Code for use with local LLMs, supporting full air-gapped (offline) functionality.

⁠Features

  • Run Claude Code in a Docker container with local LLMs
  • Full offline/air-gapped support after initial model download
  • GPU acceleration support
  • Persistent storage for models and code

⁠Quick Start

⁠Basic Usage

Download and run the devstral-small-2 model on a local GPU:

docker run --rm -it --gpus=all -v ./models:/root/.ollama -v ./code:/code --name local_claude muritiku/local_claude:latest devstral-small-2

This creates two folders:

  • code - contains the code generated by Claude
  • models - stores the downloaded model files
⁠Offline Mode

Once the models are cached, you can migrate the Docker image and the models directory to a network-isolated environment. All operations are then performed entirely offline.

⁠Advanced Usage

⁠System Integration

Create a script named claude in $HOME/.local/bin (or any directory in your $PATH):

#!/usr/bin/env bash
# script location: $HOME/.local/bin/claude

docker run --rm -it --gpus=all -v ~/.claude_docker:/root/.claude -v ~/.claude_models:/root/.ollama -v $(pwd):/code --name local_claude muritiku/local_claude:latest devstral-small-2

Make the script executable:

chmod +x $HOME/.local/bin/claude

Now you can run Claude from any folder to work with the code in your current directory. This also works with the official Anthropic VSCode plugin (anthropic.claude-code) in CLI mode.

Claude Code data will be cached in ~/.claude_docker, and models in ~/.claude_models. This ensures that your data and settings persist between sessions.

⁠Configuration

  • GPU Support: Use --gpus=all for GPU acceleration
  • CPU Only: Omit the --gpus=all flag to run on CPU (slower)
  • Persistent Storage: Mount volumes for models and code as shown in examples

⁠Dependencies

This project relies on:

  • Docker for containerization
  • Claude Code as the main interface
  • Ollama for running LLMs locally

⁠Happy Coding!

Tag summary

Content type

Image

Digest

sha256:aa5628488…

Size

3.6 GB

Last updated

6 months ago

docker pull muritiku/local_claude