Skip to main content
JavaScript examples use @beamcloud/beam-js 1.1.0 or later. Configure the SDK before running them. Enable the Docker daemon when creating your VM. Prepared VM images already include Docker, Compose, and Buildx:
The docker info check waits for Docker to start. SDK Docker helpers handle this automatically. 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

Python 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 Python SDK Compose helpers share the VM’s network and PID namespaces and reuse that configuration for later stack operations:
JavaScript Docker commands return the same process handles as vm.exec(): use await command.wait(), await command.stdout.read(), and for await (const line of command.logs). JavaScript Compose runs the provided argv; configure ports or host networking in your Compose file. 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. Nested Docker containers do not inherit the VM’s brokered-secret CA. Mount /etc/beam/ca-certificates.crt read-only into containers that use brokered credentials and configure their clients to trust it; for example, set SSL_CERT_FILE to the mounted path. See brokered secrets for header substitution and trust limitations.