Skip to content

feat(docker): add Docker-in-Docker feature for testcontainers#4

Merged
arv merged 1 commit into
mainfrom
add-docker-feature
Jun 11, 2026
Merged

feat(docker): add Docker-in-Docker feature for testcontainers#4
arv merged 1 commit into
mainfrom
add-docker-feature

Conversation

@arv

@arv arv commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

Adds a new docker dev container feature that gives containers a self-contained Docker daemon, mirroring how agents wraps the official claude-code/github-cli features.

It dependsOn the official docker-in-docker feature (engine + in-container daemon + adds the remote user to the docker group) 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 test in packages/zero-cache errors with:

Error: Could not find a working container runtime strategy
 ❯ PostgreSqlContainer.start .../@testcontainers/postgresql/...
 ❯ Object.setup test/pg-container-setup.ts:5:23

The pg test suite spins up Postgres via testcontainers, which needs a Docker daemon. The dev container ships none (no docker binary, 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

"features": {
  "ghcr.io/rocicorp/devcontainer-features/docker:1": {}
}

Follow-up

Once this merges and the release workflow publishes ghcr.io/rocicorp/devcontainer-features/docker, the consumer change in rocicorp/mono (.devcontainer/devcontainer.json references the feature) can be merged/rebuilt.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot requested a review from grgbkr June 11, 2026 12:50
@arv arv merged commit 0df27aa into main Jun 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant