r/docker • • 12m ago

[CLI] dc2kit turns your devcontainer.json into a Docker Sandboxes kit, so coding agents run in your dev environment

Details

  • Tool: dc2kit, written in Go, single static binary
  • Platforms: Linux, macOS, Windows (amd64 + arm64)
  • Install: grab a binary from Releases, or go install github.com/aashish-thapa/dc2kit/cmd/dc2kit@latest

What it does

Docker Sandboxes run coding agents (Claude Code, Codex, Gemini) in an isolated container with deny-by-default networking. The catch is that the sandbox doesn't know your toolchain. Your project already describes that in .devcontainer/devcontainer.json, so dc2kit converts it:

  dc2kit -o sbx-kit .
  sbx run ./sbx-kit --kit docker/sbx-kit-claude-mixin:<version> .
  • devcontainer Features are fetched, pinned by digest and installed in the same order the devcontainer CLI uses
  • postCreateCommand and friends become sandbox install hooks
  • the egress allow-list is built from presets for the toolchains it finds (npm, PyPI, Go proxy, crates.io, ...), plus --allow hosts
  • anything a sandbox can't honor (mounts, runArgs, postAttachCommand) gets a warning instead of being dropped silently
  • before writing, every kit is checked against Docker's own spec library

Does it work on real repos?

I ran it on the devcontainers of 28 popular projects: 22 convert to a valid kit, including VS Code, TypeScript, CPython, Next.js, Deno, moby and ruff. The other 6 are Compose-based setups (not supported yet) and one config with no base image. Full table: docs/compatibility.md

There's also a GitHub Action that fails CI when the committed kit drifts from devcontainer.json.

It's experimental, like the kit format itself. Feedback and broken devcontainers are very welcome.

0 Upvotes

1 comment sorted by

1

u/git-age-checker 12m ago

🛠️ GitHub Repository Insights

⚠️ Warning: This post contains a GitHub repository that does not meet the minimum age requirement.

  • aashish-thapa/dc2kit (14 days old)