This article explains how to run Claude Code in a sandboxed Docker container using a single installation script.The solution creates a minimal Docker image based on node:22-slim, pre-installs Claude Code and the rtk CLI, and sets up shell aliases for easy access.
Two aliases are provided: 'claude-docker' launches the application with full permissions inside the container, while 'claude-docker-sh' grants access to a bash shell within the same environment.The containerized approach limits risks by restricting Claude's access to only the project directory and a dedicated non-root user account.This method avoids modifying system PATH or installing separate binaries, relying instead on shell aliasing.The script requires Docker to be pre-installed and supports both bash and zsh shells.Key benefits include enhanced security through containerization while maintaining flexibility for development tasks.
Original title: claude-docker: one command, one container, full permissions
The AI system has determined that this news is not clickbait/sensationalist: : The original title is descriptive and accurately reflects the technical solution presented in the article, without sensationalist language. This has coincided with the opinion of the majority of users.