commit#

SandboxRuntime.commit(instance_id: str, image: str, env: Dict[str, str] | None = None, timeout_seconds: float = 1800.0) → str[source]#

Push the sandbox’s base image and root filesystem changes to a registry.

The sandbox must have been created with readonly=False. Mounts aren’t included. Commit leaves the sandbox in the state it was in: a running sandbox is paused only while its changes are exported, and a paused sandbox stays paused. Registry credentials come from $DOCKER_CONFIG and must allow push.

Parameters:
  • instance_id (str) – Unique identifier of the sandbox instance.

  • image (str) – Target reference with a tag, such as registry/repo:tag.

  • env (Dict[str, str] | None) – Variables to replace or extend the base image config’s Env.

  • timeout_seconds (float) – Timeout for export and each registry request.

Returns:

The immutable registry/repo@sha256:... reference.

Return type:

str