Docker の検索・質問

sbx rm

マークダウン参照
内容説明Remove one or more sandboxes
利用方法sbx rm [SANDBOX...] [flags]

Description

Remove one or more sandboxes. With --cloud, pass sandbox IDs (sbx_*) or names from "sbx --cloud ls".

For local sandboxes, stops them, removes their containers, removes any Git remote added to the host repository for them, deletes sandbox state, and deletes secrets scoped to each removed sandbox. Host-mount directories and persistent volume@1 storage created with retention support are kept; creating the same sandbox name with the same kit reattaches its persistent volumes. This action cannot be undone. With --cloud, deletes the sandbox in Docker Sandboxes Cloud. This action cannot be undone. Once the server accepts the request, rm waits up to 60 seconds per sandbox for the deletion. A removal still completing after that exits 0. Verify it later with "sbx --cloud ls".

Removal requires confirmation; use --force to skip confirmation prompts (for non-interactive scripts) and to delete a sandbox that is in use (e.g. an open SSH connection). Use --all to remove every sandbox. With --cloud, --all is intentionally disabled as a safety gate — the blast radius covers every sandbox the credential can see, which may include shared or production workloads. Pass IDs explicitly in --cloud mode.

Options

オプションデフォルト内容説明
--allRemove all sandboxes
-f, --forceSkip confirmation prompts and delete a running sandbox or one in use (e.g. an open SSH connection)
--formatOutput format: table, json or yaml
--jsonOutput in JSON format

Global options

オプションデフォルト内容説明
--cloudDispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list)
-D, --debugEnable debug logging
--no-inputNever prompt; commands that need an answer fail with the command to run instead

Examples

sbx rm my-sandbox

# Remove several at once
sbx rm one two

# Remove every sandbox without asking
sbx rm --all --force

# Remove a cloud sandbox by name or ID
sbx --cloud rm my-sandbox
sbx --cloud rm sbx_abc123

# Remove specific cloud sandboxes without confirmation
sbx --cloud rm sbx_abc123 sbx_def456 --force