mirror of
https://github.com/docker/docs.git
synced 2026-11-04 10:01:00 +00:00
Vendor the checked-in CLI YAML from Docker Sandboxes release/v0.51 at 7d55286de0c7. This updates command help, adds `sbx policy check http`, and replaces seven agent-specific create pages with redirects to `sbx create`. Validation: full site build with Hugo 0.169.0; upstream byte-for-byte comparison; all 115 command pages, reference links, and seven redirects checked; template formatting and whitespace checks passed.
73 lines
3.1 KiB
YAML
73 lines
3.1 KiB
YAML
name: sbx template save
|
|
synopsis: Save a snapshot of the sandbox as a template
|
|
description: |-
|
|
Save a sandbox snapshot as a template in the local image store.
|
|
Use --pull never when creating a sandbox from the saved template.
|
|
|
|
The image the sandbox was created from must still be in the local image
|
|
store. If it was removed, restore it first, for example with sbx template load.
|
|
|
|
Use --output to export a tar file for loading on another host with
|
|
sbx template load.
|
|
|
|
With --cloud:
|
|
Snapshot a running cloud sandbox into a cloud-managed template. The
|
|
snapshot can take several minutes for kit-sized images; the command
|
|
polls for completion. Use --description to attach a free-form description
|
|
to the saved template.
|
|
|
|
--capture-mode controls what gets captured: "disk" (default) cold-boots
|
|
from the filesystem; "all" captures memory + disk + microVM checkpoint so
|
|
subsequent runs resume in sub-second time at the cost of a slower load.
|
|
|
|
Cloud snapshots typically produce multi-GB templates and take several
|
|
minutes to complete. See https://docs.docker.com/ai/sandboxes/ for the snapshot/load model.
|
|
usage: sbx template save SANDBOX TAG [flags]
|
|
options:
|
|
- name: capture-mode
|
|
default_value: disk
|
|
usage: |
|
|
What gets captured for this template. "disk" (default) captures only the filesystem — cold-boot from a standard OCI image, faster load. "all" captures memory + disk + microVM checkpoint — sub-second TTI on resume, slower load. Only effective with --cloud.
|
|
- name: description
|
|
usage: Description for the template (cloud only)
|
|
- name: help
|
|
shorthand: h
|
|
default_value: "false"
|
|
usage: help for save
|
|
- name: output
|
|
shorthand: o
|
|
usage: Also export the image to a tar file
|
|
inherited_options:
|
|
- name: cloud
|
|
default_value: "false"
|
|
usage: |
|
|
Dispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list)
|
|
- name: debug
|
|
shorthand: D
|
|
default_value: "false"
|
|
usage: Enable debug logging
|
|
- name: no-input
|
|
default_value: "false"
|
|
usage: |
|
|
Never prompt; commands that need an answer fail with the command to run instead
|
|
example: |4-
|
|
# Save as a template for new sandboxes on this host
|
|
sbx template save my-sandbox myimage:v1.0
|
|
|
|
# Create a sandbox from the saved template
|
|
sbx run --pull never -t myimage:v1.0 claude ./project
|
|
|
|
# Also export to a shareable tar file
|
|
sbx template save my-sandbox myimage:v1.0 --output /tmp/myimage.tar
|
|
|
|
# Cloud: snapshot a running cloud sandbox into a cloud-managed template
|
|
sbx --cloud template save sbx_abc123 my-snap
|
|
|
|
# Cloud: attach a description to the saved template
|
|
sbx --cloud template save sbx_abc123 my-snap --description "nightly build"
|
|
|
|
# Cloud: capture memory + disk + microVM checkpoint for sub-second resume
|
|
sbx --cloud template save sbx_abc123 my-snap --capture-mode all
|
|
see_also:
|
|
- sbx template - Manage sandbox templates
|