Skip to main content
Enable the Docker daemon when creating your VM. Prepared VM images already include Docker, Compose, and Buildx:
Docker’s images, build cache, container layers, and named volumes are stored in the VM root and survive stop/start. Use restart policies for containers that should start on a cold boot. Pause/resume preserves their running state with the rest of the guest.

Build and run from the SDK

Docker operations return DockerResult handles with wait(), success, stdout, stderr, and combined logs(). Unlike process.logs, Docker’s logs() is a method. Build progress often appears on stderr. The SDK Docker helpers use the VM’s network namespace. Publish the service’s actual listening port with vm.expose(); SDK host-port remapping is unsupported. Direct commands issued through SSH or vm.process.exec("docker", ...) use normal guest Docker behavior and need their own Docker networking configuration.

Compose from the CLI

Upload your project, then run Compose inside the VM:
For direct Compose commands, configure ports or host networking in your Compose file so the application is reachable on the VM’s published port.

Compose from the SDK

The SDK Compose helpers apply the shared host-network/PID configuration and reuse the same configuration for subsequent stack operations:
Upload any Dockerfiles and source referenced by Compose’s build contexts before starting the stack. Services using the SDK helpers must listen on distinct guest ports. See Docker APIs for image/container operations, and use vm.aio.docker for async calls. For long builds on an idle-limited VM, hold vm.keep_alive() or disable the TTL. For daemon diagnostics, use beam vm logs docker-dev --unit docker.service.