dock-claude
v0.1.2
Published
Run Claude Code inside Docker with the current directory mounted.
Downloads
462
Readme
dock-claude
Run Claude Code inside Docker with a host directory mounted as /workspace.
Usage
npx dock-claude
dock-claude ~/src/my-project
dock-claude . --dangerously-skip-permissionsArguments after the directory are passed to claude. Use . before Claude
flags when mounting the current directory.
Options
--image <name>: Docker image tag. Defaults todock-claude-(dirname):latest.--rebuild: rebuild before running.--docker-file <path>: Dockerfile fordocker build. Defaults toDockerfile.dock-claudein the mounted directory, falling back to the packaged Dockerfile.--docker-context <path>: build context fordocker build. Defaults to the Dockerfile directory.--guest-mount <path>: repeatable workspace-relative path hidden by a guest-only volume. Defaults tonode_modules.--mount <host:guest>: repeatable extra host bind mount. Relative host paths resolve from the current directory; guest paths must be absolute.
Examples:
dock-claude --docker-file ./Dockerfile.dev --docker-context . --rebuild .
dock-claude --guest-mount dist --guest-mount packages/app/node_modules .
dock-claude --mount ~/.ssh:/workspace/.ssh --mount ../shared:/shared .Project Setup
For a project-specific image, add Dockerfile.dock-claude to the project root:
FROM node:26-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git openssh-client \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g @anthropic-ai/[email protected]
WORKDIR /workspace
ENTRYPOINT ["claude"]Add .dock-claude to both .gitignore and .dockerignore:
.dock-claude/Notes
- The image is built on first run.
- The container runs as the current host UID/GID.
- Claude state is stored in
.dock-claude/inside the mounted directory. - Host Claude config and Anthropic-related environment variables are not forwarded.
