Skip to main content
Move stable setup out of repeated work. Record the immutable UUID produced by preparation and start later sessions or operations from that UUID.

Choose a preparation path

Use an existing image for the examples below. Tags are convenient starting points but can move; record an immutable UUID for reproducible work.

Python preparation

Complete the Python quickstart setup with SDK 0.5.1. This complete program starts from an available Alpine image, prepares files in the default lazy session, then opens an independent regular session for a disposable verification:
Expected output:
The factory closes the clients and stores it creates. snapshot() stops the preparation VM. Files survive in the checkpoint; its processes, memory, services, and network connections do not.

Import an image from a registry

Import an OCI image when the available Sandboxes images do not contain the filesystem needed for a workload. After the Python access setup, run:
The helper returns an immutable UUID to pass as image=image_uuid in later sessions. Async programs can use await async_import_image(...). Importing requires the service to reach the registry; this example uses a registry mirror. Import supplies the filesystem without executing CMD or ENTRYPOINT or applying OCI WORKDIR to later commands. Select the command and working directory explicitly.

Dockerfile and refresh rules

SDK 0.5.1 provides sync_build_image() and async_build_image(); see Build an image for supported instructions and caching. CLI 0.9.4 supports FROM, RUN, COPY/ADD, WORKDIR, ENV, ARG, and USER. Multi-stage AS is parsed but not executed by that CLI version. Each CLI RUN is a Sandboxes operation; use --no-cache for a deliberate rebuild. Pin base images and dependencies, record the final UUID with the source revision, run a disposable smoke test, then move a shared tag. Keep registry credentials and build secrets outside uploaded files, retained environment values, and command output. See Build and refresh a reusable custom environment and Update images and clients.