Skip to main content
Run Docker Compose inside a microVM when a test needs several containers. The inner daemon uses the sandbox’s flat root disk and never receives the host’s /var/run/docker.sock. This example assumes ./my-project contains compose.yaml and a test service named test.

Run the integration tests

1

Start Docker

The flat root gives Docker a direct ext4 filesystem for its own overlay storage, avoiding an overlay-on-overlay stack. Its 10 GiB capacity covers the image, project, build cache, and containers.Copy the project into the running sandbox. This happens after creation because flat roots do not currently accept create-time rootfs patches such as --copy-dir:
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.
msb cp makes a guest copy. Use a clean project directory, and do not copy credentials or unrelated files into the sandbox.
3

Clean up

Stop the Compose stack inside the sandbox:
Remove the sandbox:
Removing the sandbox also removes Docker’s image and build cache. Keep the sandbox between trusted runs if you want to reuse that cache; do not carry 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.