Skip to main content
Use a custom image to include your application’s dependencies and startup command. The CLI can build a Dockerfile remotely or package an existing local Docker image. Both flows return a build ID; the build continues after the command exits.

Before you start

Install and configure the CLI. Use hx 0.1.25 or later for GPU image builds.

Build from a Dockerfile

Use --remote to upload your build context and run its Dockerfile in an isolated remote builder. The default Dockerfile path is Dockerfile; use --dockerfile for a different path relative to the context directory. Builds target linux/amd64. For GPU sandboxes, also pass --enable-gpu-builds. This publishes the GPU image alongside the CPU image. GPUs are attached only when a sandbox runs, so GPU computations cannot run during the build. Exporting an existing local Docker image for GPU use is not supported. The GPU guide includes a complete Dockerfile and remote build example.

Build from a local Docker image

With Docker available locally, export and build an existing image:
Without --remote, the command:
  • Exports your local Docker image.
  • Compresses the archive locally.
  • Uploads it to the Hyperbrowser artifact store.
  • Dispatches the remote image build and returns its build ID.

Wait for the image

Use hx vm image status <build-id> for a single status check, or hx vm image wait <build-id> to poll until the image is ready, the build fails, or it is canceled. For builds requested with --enable-gpu-builds, the wait command also waits for GPU publication. If you poll the build API, wait for gpuImageReady: true before creating a GPU sandbox. status: "completed" describes build completion and does not by itself confirm GPU readiness. If GPU publication fails, rebuild the image.

Launch a sandbox from the image

After the image is ready, use its registered name to create a sandbox. The examples below create CPU sandboxes; follow GPU creation to request a GPU and wait for provisioning.

List available images

Use this to confirm the image name before launch. For GPU readiness, check the image build rather than the image list.

Image startup defaults

hx vm image build reads Docker-config environment variables and the image’s ENTRYPOINT/CMD, then attaches them as launch-time defaults. Use --env KEY=VALUE to add or override default environment variables. Use --entrypoint '...' to override the detected startup command for sandboxes launched from that image.
Docker-defined environment variables and startup commands are auto-detected by default. Explicit --env and --entrypoint values take precedence over the detected values.