| 说明 | 删除模板镜像 |
| 用法 | sbx template rm TAG|DIGEST|ID|NAME [flags] |
描述
从沙箱运行时镜像仓库中删除模板镜像。
可以通过标签、仓库摘要(REPOSITORY@sha256:DIGEST)或镜像 ID(完整值或前缀) 来指定镜像。用 "sbx template ls --all --digests" 查看可用的镜像及其摘要。
使用 --cloud 时: 按名称或 tmpl_* ID 删除云端沙箱模板。 用 "sbx --cloud template ls" 列出模板。
选项
| 选项 | 默认值 | 说明 |
|---|---|---|
-f, --force | 跳过确认询问 | |
--format | 输出格式:table、json 或 yaml | |
--json | 以 JSON 格式输出 |
全局选项
| 选项 | 默认值 | 说明 |
|---|---|---|
--cloud | 改为调用 Docker Cloud Sandboxes API,而不是本地 sandboxd(支持的动词正在逐步增加,运行 sbx --cloud --help 查看当前列表) | |
-D, --debug | 启用调试日志 | |
--no-input | 从不提示;需要应答的命令会直接失败,并给出应当运行的命令 |
示例
console
# 按标签删除
sbx template rm myimage:v1.0
# 按镜像 ID(前缀)删除
sbx template rm abc123
# 按仓库摘要删除
sbx template rm myimage@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
# 云端:按名称删除
sbx --cloud template rm my-template
# 云端:按 tmpl_* ID 删除
sbx --cloud template rm tmpl_abc123参见
sbx template— 管理沙箱模板