cd /news/developer-tools/claude-docker-one-command-one-contai… · home topics developer-tools article
[ARTICLE · art-73882] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

claude-docker: one command, one container, full permissions

A developer created claude-docker, a one-command install script that runs Claude Code inside a Docker container with full permissions but limited filesystem access. The script builds a minimal image with Claude Code and the rtk CLI, then sets up shell aliases to launch the container with --dangerously-skip-permissions while mounting only the current project directory, reducing risk compared to running on the bare host.

read2 min views1 publishedJul 26, 2026

If you've ever wanted to run Claude Code with full permissions, without worrying about it touching anything outside your project. This one-liner install script does exactly that.

The script builds a minimal Docker image (node:22-slim

) with Claude Code and the rtk

CLI pre-installed, then wires up two shell aliases:

— launches Claude Code inside the container withclaude-docker

--dangerously-skip-permissions

, your current directory mounted at/workspace

— drops you into a bash shell in the same container, useful for poking around or debuggingclaude-docker-sh

Because everything runs inside the container, "skip permissions" mode is much less risky than running it on your bare host — Claude can act freely, but it's boxed into the container's filesystem plus whatever you've explicitly mounted.

Under the hood, the install script just appends two docker run

one-liners to your shell rc file as aliases — no separate binary, no PATH changes, just plain shell aliasing. That's what makes claude-docker

and claude-docker-sh

available as regular commands once the file is sourced.

The image itself starts from node:22-slim

and installs git

, curl

, and gh

via apt, then @anthropic-ai/claude-code

via npm, plus the rtk

CLI through its own install script. It also creates a dedicated non-root claudeuser

to run as, rather than executing everything as root inside the container.

Docker needs to be installed and running first — the script builds an image and everything else depends on that.

Two versions are available depending on your shell:

bash:

curl -s https://gist.githubusercontent.com/acashjos/93f47fce263dcaaa1cd5ba38b4459ffb/raw/5944ef120f150ca08287d406ff3397a6687b871f/claude-docker-install-bash.sh | sh

zsh:

curl -s https://gist.githubusercontent.com/acashjos/93f47fce263dcaaa1cd5ba38b4459ffb/raw/5944ef120f150ca08287d406ff3397a6687b871f/claude-docker-install-zsh.sh | sh

Or download it first, review it, then run:

curl -O https://gist.githubusercontent.com/acashjos/93f47fce263dcaaa1cd5ba38b4459ffb/raw/5944ef120f150ca08287d406ff3397a6687b871f/claude-docker-install-bash.sh
chmod +x claude-docker-install-bash.sh
./claude-docker-install-bash.sh

The script builds the image, appends the aliases to your .bashrc

(or .zshrc

), and sources the file so they're available immediately.

From any project directory:

claude-docker

This mounts your current working directory into the container and starts Claude Code with all permissions granted. On first run, use the /login

command inside Claude Code to complete authentication.

Need a plain shell in the same environment instead?

claude-docker-sh

Running Claude Code with --dangerously-skip-permissions

on a bare host means it can read, write, or execute anything your user account can. Wrapping it in Docker with only $HOME/.claude-docker

and your project directory mounted keeps the blast radius contained to those two paths — a reasonable middle ground between full manual approval and full autonomy.

Full source and both shell variants: gist.github.com/acashjos/93f47fce263dcaaa1cd5ba38b4459ffb

── more in #developer-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-docker-one-co…] indexed:0 read:2min 2026-07-26 ·