Skip to main content
This plugin provisions a dedicated Docker-in-Docker (DinD) daemon and configures Testcontainers to connect to it during build time, providing an isolated Docker engine.

Usage

plugins:
  - TestcontainersDinD@v1
When running buildcharts generate, the plugin starts or reuses the DinD container, updates .buildcharts/docker-bake.hcl, and leaves the Docker daemon running for reuse (memory footprint ~40 MB).

What it does

  • Starts a buildcharts-dind container using the docker:27-dind image
  • Reuses the container if it already exists, or removes and recreates it if the image differs
  • Runs the container in privileged mode, binds port 2375, and disables TLS
  • Supports BUILDCHARTS_DIND_IMAGE to override the Docker image tag
  • Patches the generated docker-bake.hcl for target "test":
    • TESTCONTAINERS_HOST_OVERRIDE - arg with DinD container IP
    • host.docker.internal - extra host that resolves to the host gateway
  • Writes .buildcharts/plugins/TestcontainersDinD@v1/container_debuginfo.json

Environment variables

  • BUILDCHARTS_DIND_IMAGE

Notes

  • If the generated Bake plan has no test target, the patch step is skipped.
  • The plugin leaves the buildcharts-dind container running for reuse across builds.

Read more

Last modified on March 15, 2026