Skip to main content
Run Docker Compose inside a microVM when a test needs several containers. The inner daemon gets its own disk and never receives the host’s /var/run/docker.sock. This example assumes the current directory contains compose.yaml and a test service named test.

Run the integration tests

1

Start Docker

The official dind image starts dockerd. Wait for it before sending Compose commands:
2

Run the tests

Replace test with the service whose exit code should decide the CI result. msb exec returns that code to the host.
--copy-dir makes a guest copy. Run the command from a clean project directory, or replace it with narrower --copy-file and --copy-dir flags when the checkout contains credentials or unrelated files.
3

Clean up

Stop the Compose stack inside the sandbox:
Remove the sandbox:
Delete the cache only when you no longer need it:
Keep the named volume if you want a repository-specific image cache between trusted runs. Do not share a writable cache across repositories or trust boundaries.
Never mount the host Docker socket into the sandbox. Control of that socket is normally control of the host Docker daemon and defeats the microVM boundary.