Streamlining Local Development with Dev Containers and Testcontainers Cloud
Testcontainers-based tests and services can run inside a dev container by giving the container Docker access, either through the Docker-in-Docker feature or by swapping in the Testcontainers Cloud feature, which runs an agent that points Docker calls at a remote cloud environment. A walkthrough using IntelliJ's Dev Containers plugin and a Spring Boot Java 21 workshop repo shows both devcontainer.json configurations. The Testcontainers Cloud setup passes a TC_CLOUD_TOKEN via an env file kept out of git, sets TCC_PROJECT_KEY to group sessions, and is checked through the agent log. Moving to Testcontainers Cloud is pitched as avoiding Docker-in-Docker's security concerns and local resource load.
Related posts
- Why Testcontainers Cloud Is a Game-Changer Compared to Docker-in-Docker for Testing Scenarios
Docker mediumAdeptDocker-in-Docker, commonly used to give CI jobs a Docker daemon for Testcontainers integration tests, requires privileged mode and nests storage drivers, cgroups and namespaces, which leads to security audit problems, flaky builds, slow pipelines and hard debugging. Testcontainers Cloud offloads container execution to a cloud service through an agent, removing the need for privileged containers or a local Docker socket. Setup in GitHub Actions takes a service-account token stored as TC_CLOUD_TOKEN and the atomicjar/testcontainers-cloud-setup-action step before running tests. The claimed gains in build speed and maintenance are anecdotal and not quantified.
- Run Your Project in a Dev Container, in Zed
Zed mediumAdeptZed v0.218 can open projects inside Dev Containers defined by `.devcontainer/devcontainer.json`, giving teams reproducible development environments. It reuses Zed's SSH remote-development architecture: the local Zed runs the GPUI interface and spawns a Zed remote server that handles files, language servers and parsing, communicating over stdin/stdout. Supporting containers only needed a new transport over `docker exec`. Containers are created by calling the reference `devcontainer up` CLI, which got the feature shipped quickly but means `forwardPorts` and Zed-specific `customizations` such as extensions are not supported yet. A planned in-house implementation is meant to add both.
- Functional tests with Testcontainers
Zalando Engineering mediumAdeptBlack-box functional tests for a Spring service can run against the service packaged as a Docker image, with PostgreSQL and other dependencies started as separate containers via Testcontainers. The setup uses a Maven multi-module layout where the functional-tests module has no dependency on service code. Tests talk to the service only through plain JSON over its public REST API, and a shared abstract base class starts containers once with health-check waits, log consumers, a remote debug port and a shutdown hook as a backstop to Ryuk. The approach gives strong confidence during deep refactoring and also verifies the Docker packaging. Its costs are slow container startup (about 4s for Postgres, up to 20s for Localstack), harder debugging, and the need to isolate test data because containers are shared across tests.
- Develop Kubernetes Operators in Java without Breaking a Sweat
Docker mediumAdeptKindcontainer, a Testcontainers extension, enables integration testing of Java-based Kubernetes operators and controllers against real API servers running in Docker. It offers ApiServerContainer for fast API-server-only tests and K3sContainer/KindContainer for full single-node clusters (startup can exceed a minute), all behind a common API so tests can switch without code changes. Fluent kubectl and Helm APIs run in separate containers to install CRDs and charts before tests, Kubernetes versions are pinned via enums, and images can come from private registries. Admission webhooks running in the test JVM are reachable through an SSH reverse tunnel plus an Nginx container for TLS termination, all configured automatically.
- Highlights from AWS re:Invent: Supercharging Kiro with Docker Sandboxes and MCP Catalog
Docker mediumAdeptDocker Sandboxes run coding agents like AWS's Kiro inside isolated containers that see only the project directory and none of the host's credentials, while the Docker MCP Toolkit supplies tools through a gateway that injects secrets only into the specific MCP server that needs them. The walkthrough uses `docker sandbox run --mount-docker-socket kiro` (the socket lets Testcontainers integration tests run), points Kiro at the MCP Gateway via a project-level `.kiro/settings/mcp.json`, and uses an AGENTS.md file to have the agent add the GitHub MCP server on demand and remove it afterward to shrink context and cost. The result is a least-privilege, per-container setup. Planned additions include hostname-based network egress limits against prompt-injection exfiltration and organizational governance of allowed MCP servers. Sandboxes are an experimental feature in Docker Desktop 4.50+.