一键 Docker 开发环境,适用于任意项目。自动识别 20+ 项目类型(Nuxt/Next/Vite/Python/Go/Rust/Java/Ruby/PHP/C#/Swift/Hugo),匹配本地语言配置...
Create isolated Docker dev environments for any project with a single command.
The scripts/devbox.sh script:
docker-compose.dev.yml with the matching Docker imageAll generated files use named volumes, never bind-mounted to the host:
node_modules, pip, m2, gems, etc.).nuxt, .next, go-build, cargo-target, etc.)pnpm-store, composer, nuget, etc.)Benefits: no host/container cache collisions, native speed on macOS, cache survives container rebuilds.
After installing this skill, run the bundled script directly:
bash
SKILL_DIR=$(clawhub list --json 2>/dev/null | python3 -c "import sys,json; print([s['folder'] for s in json.load(sys.stdin) if s.get('slug')=='docker-devbox'][0])" 2>/dev/null || echo "skills/docker-devbox")
# Run devbox
bash "$SKILL_DIR/scripts/devbox.sh" /path/to/project
# Or copy to PATH for convenience
cp "$SKILL_DIR/scripts/devbox.sh" /usr/local/bin/devbox
chmod +x /usr/local/bin/devbox
devbox /path/to/project
bash
# Auto-detect project type
devbox /path/to/project
# Specify port + attach databases
devbox /path/to/project 8000 --with postgres,redis
# Force framework
devbox /path/to/project --framework java-spring
TypeDetectionDefault PortDocker ImageNuxt 3/4nuxt.config.*3000node:{ver}-bookwormNext.jsnext.config.*3000node:{ver}-bookwormVue + Vitevite.config.* + vue5173node:{ver}-bookwormReact + Vitevite.config.* + react5173node:{ver}-bookwormSveltesvelte.config.*5173node:{ver}-bookwormVitePressdocs/.vitepress/5173node:{ver}-bookwormNode.js backendpackage.json3000node:{ver}-bookwormPython FastAPIrequirements.txt + fastapi8000python:{ver}-slimPython Djangomanage.py8000python:{ver}-slimPython Flaskrequirements.txt + flask5000python:{ver}-slimGogo.mod8080golang:{ver}RustCargo.toml8080rust:{ver}Java (Spring Boot)pom.xml + spring-boot8080eclipse-temurin:{ver}-jdkJava (Maven)pom.xml8080eclipse-temurin:{ver}-jdkJava (Gradle)build.gradle / .kts8080eclipse-temurin:{ver}-jdkKotlin*.kt (no build.gradle)8080eclipse-temurin:21-jdkRuby on RailsGemfile + rails3000ruby:{ver}-slimRuby SinatraGemfile4567ruby:{ver}-slimPHP Laravelcomposer.json + laravel5000php:{ver}-cliPHPcomposer.json8000php:{ver}-cliC# / .NET*.csproj / *.sln5000dotnet/sdk:{ver}SwiftPackage.swift8080swift:{ver}Hugohugo.toml1313klakegg/hugo:ext-alpineStatic HTML*.html80nginx:alpine
bash
devbox ./app --with postgres,redis
ServiceImagePortpostgres / pg``postgres:16-alpine5432mysql``mysql:8-alpine3306redis``redis:7-alpine6379mongo``mongo:727017minio``minio/minio9000/9001
text
devbox <project-path> [port] [options]
Options:
--framework <type> Override auto-detection
--with <services> Comma-separated services to attach
--env-file <path> Environment variable file
--use-dockerfile Use project's existing Dockerfile
-h, --help Show help
项目类型命名卷Nuxtnm, pnpm-store, nuxt, nuxt-outputNext.jsnm, nextVue/React/Vite/Sveltenm, pnpm-storePythonpipGogo-mod, go-cacheRustcargo-registry, cargo-git, cargo-targetJava Mavenm2Java GradlegradleRubygemsPHPcomposer.NETnugetSwiftswift
text
scripts/devbox.sh — Main script (auto-detect + generate compose)
scripts/create-dev-env.sh — Backward-compatible wrapper
references/docker-templates.md — Ready-to-use compose templates with volume isolation
Required:
docker + docker compose — the only hard requirementOptional (for version detection):
node, python3, go, rustc, java, ruby, php, dotnet, swiftpnpm / yarn / bun — Node.js package manager detectionOptional (for port conflict detection):
lsof — Detects host processes using a portOnly the runtimes installed on your host are used. If a language is not installed, the script falls back to a sensible default version.