Claude Code CLI image with directories and .env config setup
668
Light-weight Docker wrapper for Claude Code CLI, installing it in an isolated container to avoid direct installation in a host machine. Installed with Node.js 24.11.0, Python3 and pip.
INFO: This Docker setup is similar to weaponsforge/gemini-cliโ , but for the Claude Code CLI.
Pre-installed Playwright and Chromium: to use an image with pre-installed Playwright and Chromium, build with https://github.com/weaponsforge/claude-cli/blob/main/Dockerfile.semiโ
This image is only for local development purposes.
GitHub Repository
https://github.com/weaponsforge/claude-cliโ
Choose between the two (options):
1. Anthropic account with Claude subscription (Pro, Max, Team, or Enterprise)
2. Anthropic account with at least $5 API credits
ANTHROPIC_API_KEY key and the "Anthropic Console account ยท API usage billing" option with Claude Code CLI loginANTHROPIC_API_KEY is linked with a Workspace under your account.docker pull weaponsforge/claude-cli
.env file from the .env.example file.ANTHROPIC_API_KEY with your own Anthropic API key.๐กINFO: Use this option if you don't have a Claude subscription,
but have at least $5 credits for Claude API.
Prepare the project code folder that which may optionally require a .env file.
โผ๏ธ IMPORTANT:
The project folder must be the root of your Node.js application (typically the directory containing package.json and /node_modules), not a parent directory containing the app.
For example if your project is a Node.js/React app under the "my-app" folder:
โโ my-app
โ โโ .env # optional
โ โโ package.json
โ โโ package-lock.json
โ โโ node_modules
โ โโ public
โ โโ app
โ โโโโ favicon.ico
โ โโโโ globals.css
โ โโโโ layout.tsx
โ โโโโ page.tsx
โ โโ components
โ โโโโ ...
Mount it in the container using:
Bash (with .env file)
docker run -it --rm \
--name weaponsforge-claude-cli \
--security-opt no-new-privileges:true \
--cap-drop ALL \
-v /path/to/my-app:/opt/app \
-v /opt/app/node_modules \
-v /opt/app/.next \
-v /opt/app/node_modules/.vite \
-v /opt/app/node_modules/.tmp \
--env-file /path/to/my-app/.env \
weaponsforge/claude-cli:latest \
claude
Bash (no .env file)
docker run -it --rm \
--name weaponsforge-claude-cli \
--security-opt no-new-privileges:true \
--cap-drop ALL \
-v /path/to/my-app:/opt/app \
-v /opt/app/node_modules \
-v /opt/app/.next \
-v /opt/app/node_modules/.vite \
-v /opt/app/node_modules/.tmp \
weaponsforge/claude-cli:latest \
claude
๐ก TIPS:
ANTHROPIC_API_KEY in the project's .env file if you are using the Anthropic API Key for Claude Code authentication instead of browser sign-in"node_modules" as an anonymous volume "-v /opt/app/node_modules" so that container npm installs don't land in the host file systemANTHROPIC_API_KEY in the .env fileAsk Claude:
analyze and explain to me this repository.
Claude should output details of the project folder mounted in step #3 (eg.,
"my-app")
Content type
Image
Digest
sha256:e5d84a68aโฆ
Size
491.9 MB
Last updated
8 days ago
docker pull weaponsforge/claude-cli