feat(docker): add Docker-in-Docker feature for testcontainers#4
Merged
Conversation
Adds a `docker` feature that gives dev containers a self-contained Docker daemon via the official docker-in-docker feature (pulled in with dependsOn). This unblocks tooling that shells out to Docker — notably the zero-cache Postgres testcontainers tests, which fail in the dev container today with "Could not find a working container runtime strategy". Uses docker-in-docker rather than docker-outside-of-docker so testcontainers' bind mounts and container networking work across Codespaces, CI, and local hosts without depending on a host socket. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
dockerdev container feature that gives containers a self-contained Docker daemon, mirroring howagentswraps the official claude-code/github-cli features.It
dependsOnthe officialdocker-in-dockerfeature (engine + in-container daemon + adds the remote user to thedockergroup) and serves as the single, centrally-pinned entry point for Docker across rocicorp repos.Why
Tooling that shells out to Docker fails in the dev container today. Running
pnpm testinpackages/zero-cacheerrors with:The pg test suite spins up Postgres via testcontainers, which needs a Docker daemon. The dev container ships none (no
dockerbinary, no socket).Why docker-in-docker (not docker-outside-of-docker)
testcontainers relies on bind mounts and container-to-container networking. The host-socket approach breaks bind-mount path translation and isn't available in every environment (Codespaces, CI). A self-contained daemon works everywhere.
Usage
Follow-up
Once this merges and the release workflow publishes
ghcr.io/rocicorp/devcontainer-features/docker, the consumer change inrocicorp/mono(.devcontainer/devcontainer.jsonreferences the feature) can be merged/rebuilt.🤖 Generated with Claude Code