A Claude Code skill for container-based development with Docker. Ensures all package installations and code execution happen inside containers, keeping your host machine clean.
git clone https://github.com/wrsmith108/docker-claude-skill.git ~/.claude/skills/dockerNever run npm, node, npx, tsx, or project scripts directly on the host machine.
Always use docker exec <container-name> <command> instead.
- First-Time Setup Guide: Step-by-step configuration for new projects
- Native Module Compatibility: Alpine vs Slim decision guide (glibc requirements)
- Enforcement Rules: Block npm/node commands from running on host
- Pre-Flight Checks: Verify container status before commands
- Command Reference: docker exec, docker-compose patterns
- Troubleshooting: Common issues including
ERR_DLOPEN_FAILEDfixes - Project Configuration:
.claude/docker-config.jsonfor per-project settings
Create .claude/docker-config.json:
{
"containerName": "my-project-dev-1",
"baseImage": "node:20-slim",
"port": 3000,
"hasNativeModules": true
}| Your Project Has | Use |
|---|---|
| Native modules (sqlite, sharp, bcrypt) | node:20-slim |
| Pure JavaScript/TypeScript only | node:20-alpine |
| Unsure | node:20-slim (safe default) |
docker compose --profile dev up -d
docker exec my-project-dev-1 npm installdocker exec my-project-dev-1 npm test
docker exec my-project-dev-1 npm run build
docker exec my-project-dev-1 npm run lint- Clean Host: No node_modules pollution on your machine
- Reproducible: Same environment for all developers
- Isolated: Project dependencies don't conflict
- Secure: No global package installations
MIT - See LICENSE