Skip to main content
On this page

deno 沙箱

Command line usage:
deno sandbox [OPTIONS] [args]...

deno sandbox 命令允许你启动一个安全的 Linux 微型虚拟机,旨在为在沙箱环境中运行不受信任的代码提供支持。请参阅 沙箱文档 获取更详细的使用示例。

认证 Jump to heading

为了使用 deno sandbox 命令,你需要拥有一个 Deno Deploy 账户和有效的认证令牌。请按照 开始使用 Deno 沙箱 文档中的说明操作。

全局选项 Jump to heading

  • -h, --help - 显示帮助信息。
  • --token - 使用的认证令牌。
  • --config - 配置文件路径。
  • --org - 组织名称。

子命令 Jump to heading

创建新沙箱 Jump to heading

在组织中创建一个新的沙箱。接受别名 createnew

deno sandbox create

列出你的沙箱 Jump to heading

列出组织中的所有沙箱。接受别名 listls

deno sandbox list

终止沙箱 Jump to heading

立即终止一个正在运行的沙箱。接受别名 killremoverm

deno sandbox kill <sandbox-id>

复制文件 Jump to heading

在本地机器与运行中的沙箱之间复制文件。使用 copy 或其简写别名 cp

deno sandbox copy <paths...>

执行命令 Jump to heading

在现有沙箱中运行任意命令。

deno sandbox exec <sandbox-id> <command...>

示例:

deno sandbox exec sbx-1234 uptime

延长超时 Jump to heading

延长沙箱活动时间,避免超时结束。

deno sandbox extend <sandbox-id> <timeout>

接受的时间格式为数字加单位,单位可以是秒(s)、分钟(m)或小时(h)。

示例:

deno sandbox extend <sandbox-id> 30m

SSH 连接沙箱 Jump to heading

打开与沙箱的交互式 SSH 会话。

deno sandbox ssh <sandbox-id>

部署沙箱 Jump to heading

将正在运行的沙箱的状态转变为 Deno Deploy 应用。

deno sandbox deploy <sandbox-id> <app>

管理卷 Jump to heading

创建、列出和挂载持久块存储卷。

deno sandbox volumes --help

创建卷 Jump to heading

创建一个新卷。接受别名 volumes createvolumes new

deno sandbox volumes create <name>

列出卷 Jump to heading

列出组织中的所有卷。接受别名 volumes listvolumes ls

deno sandbox volumes list

删除卷 Jump to heading

删除一个卷。接受别名 volumes deletevolumes rmvolumes remove

deno sandbox volumes delete <volume-id-or-slug>

或者

deno sandbox volumes delete <volume-slug>

卷快照 Jump to heading

创建卷的快照。接受卷 ID 或别名及快照别名。

deno sandbox volumes snapshot <volume-id-or-slug> <snapshot-slug>

或者

deno sandbox volumes snapshot <volume-slug> <snapshot-slug>

管理快照 Jump to heading

为沙箱创建和恢复文件系统快照。

deno sandbox snapshots --help

创建快照 Jump to heading

创建沙箱的新快照。接受别名 snapshots createsnapshots new。需要卷 ID 或别名及快照别名。

deno sandbox snapshots create <volume-id-or-slug> <snapshot-slug>

列出快照 Jump to heading

列出组织中的所有快照。接受别名 snapshots listsnapshots ls

deno sandbox snapshots list

删除快照 Jump to heading

删除快照。接受别名 snapshots deletesnapshots rmsnapshots remove。需要快照 ID 或别名。

deno sandbox snapshots delete <id-or-slug>

切换组织或应用 Jump to heading

切换当前 Deploy 组织或应用上下文,沙箱命令将使用此进行认证。

deno sandbox switch

你找到了你需要的东西吗?

编辑此页面
隐私政策