- name
SKILL.md
ไฟล์สกิลยังคงอยู่ในรีโพซิทอรีของผู้เผยแพร่
วางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add docker/skills --skill docker-sandboxes-env -a cursor -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add docker/skills --skill docker-sandboxes-env -a claude-code -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add docker/skills --skill docker-sandboxes-env -a codex -yวางคำสั่งที่คัดลอกไว้ในเทอร์มินัล คำสั่งจะติดตั้ง SKILL.md นี้ลงในเอเจนต์ตัวนั้น
npx skills add docker/skills --skill docker-sandboxes-env -a grok -yส่งข้อความที่คัดลอกไว้ในแชต Grok Bot แล้ว Bot จะดึง SKILL.md นี้จาก GitHub และเพิ่มลงในสกิลที่ Bot ทุกตัวของคุณใช้ร่วมกัน
Install this skill: https://github.com/docker/skills/tree/HEAD/skills/docker-sandboxes-envจากผู้เผยแพร่
sbxenv.yaml (schemaVersion "1", EXPERIMENTAL) declares one local or cloud
sandbox environment: the agent, the kits composed onto it, workspace mounts,
environment variables, secrets/registries/bindings to provision, MCP servers,
ports, launch command, and host-side lifecycle commands. sbx env plan|create|run|exec|rm stand it up and tear it down reproducibly instead of a
long flag invocation. This skill owns that file end to end: authoring it from
the project's signals, refreshing its kit references, and explaining how it is
applied and approved. Decoding is strict — an unknown key anywhere is an error
— so check references/env-schema-fields.md before writing a field you are
not sure about.
Activate this skill when:
sbx create/sbx run command line, or asks to scaffold, create, or
review an sbxenv.yaml or ~/.sbxenv.yaml.sbxenv.yaml, or wants the
kit references in an existing sbxenv.yaml upgraded, bumped, or pinned to
digests.args: + --env-arg).sbx env create/run asks for approval, or why a
declared change did not take effect on an existing sandbox.Do not use this skill when:
sbx create/run/rm flag-based workflow with
no sbxenv.yaml involved — use docker-sandboxes-lifecycle.docker-sandboxes-network-credentials. This file's secrets:/
registries:/bindings: provision into that same store; do not redefine
its rules here.kits: entry references, or composing kits with sbx run --kit flags
and no environment file — use docker-sandboxes-kits. This skill only
selects, configures, and pins kits inside an sbxenv.yaml.scripts/kits.py in the current run — never from memory, an earlier
conversation, or the examples in this skill. If Docker Hub is unreachable
the helper exits nonzero; say so and stop suggesting kits rather than
guessing.latest,
edge) can sit on top. Use newestRelease/suggested from kits.py update, which ranks dotted versions numerically. Do not write a bare
untagged reference or :latest when a release tag exists.-kit suffix) and a v3 sibling exists, offer the move.ref: or command:, even if asked for a
literal: the file is meant to be committed. A binding approves a
credential; it never contains one.scripts/kits.py helperscripts/kits.py ships in this skill's directory; substitute the path this
SKILL.md was loaded from for <skill-dir>. It uses only the standard
library, prints JSON, reads public repositories anonymously, and must be run
with python3 -I. A nonzero exit means at least one lookup failed: that entry
carries error, and the other entries remain valid.
python3 -I <skill-dir>/scripts/kits.py search go github
python3 -I <skill-dir>/scripts/kits.py update sbx/playwright
./sbxenv.yaml exists → update. A project-level
./.sbxenv.yaml is not read (that name is only the home-directory
defaults file); offer to rename it to sbxenv.yaml. ~/.sbxenv.yaml is
the user's personal defaults — usually bindings and sandboxOptions, not
project kits. Nothing exists → create.search and describe candidates to
shortlist; resolve each kit's newestRelease and describe that exact
reference before configuring it; propose a composition table (kit, kind,
tag, why); set kit and environment args from that descriptor;
add bindings/secrets per credential; set workspace and options; ask tags
vs tag+digest; write the file with a prerequisites header; then run the
checks.kits: source and agent:; run kits.py update
on all OCI references in one call; present current → suggested with
notes; for each accepted change, describe old and new and reconcile
args, credentials, host grants, kind, and handle; apply only accepted
edits in place.The step-by-step procedure, the workspace-signal table, credential and host
grant handling, and the final checklist are in
references/authoring-workflow.md. Follow it rather than improvising.
agent: and kits:agent: is either a built-in agent (claude, codex, shell, …) or the
name of the agent workload kit listed under kits: — its handle as
kits.py describe reports it. To add tools to a built-in agent, keep the
built-in name in agent: and list only mixins.X and X-mixin exist, the plain kit is the workload and the
-mixin layers that agent onto another workload. Use the mixin only when
the user wants a different base.requires can under-declare what it needs from the workload:
sbx/playwright reports requires: [] but its install step needs Node, so
on the bare shell agent creation fails (env: 'node': No such file or directory). Only a disposable sbx env create proves a composition; say
so when you hand over a file you could not create.{source, args}. Explicit relative paths
(./…, ../…, ., .., or ending in .zip) resolve against the
declaring file's directory; a bare org/kit is always a registry
reference. Git sources use git+https:// or git+ssh://; pin them for
reproducibility with #ref=<commit> (plus &dir=<subdir> when needed).buildArgs
(typically version) were fixed at publish time — choose another tag
instead. buildSecrets are build inputs, never runtime credentials.kit.allowedSources setting; Docker Hub
is allowed by default. Setting it replaces the whole allowlist.--kit-arg/--kit-args-file and --env-arg/--env-args-file are
experimental flags; mention that when you rely on them.sbx env reads exactly sbxenv.yaml. Each PATH
argument is a directory (→ <PATH>/sbxenv.yaml) or the file itself.docker compose -f-style: mappings merge
by key, later scalars win, lists concatenate — except entrypoint and
cmd, which later files replace, and kits entries naming the same
source, which fold into one entry with their args merged. Each file must
be valid on its own; a later file cannot repair an invalid earlier value.
sbx env run base.sbxenv.yaml local.sbxenv.yaml
PATH, ~/.sbxenv.yaml is merged underneath the project file;
naming any PATH skips it. It may not set name:, and its workspace:
must be ${{ env.projectDir }} or a subdirectory of it.${{ env.projectDir }} (directory of the first PATH, or cwd) and
${{ env.fileDir }} (the declaring file's directory) plus
${{ env.args.NAME }} are the only expansions. A bare $ is literal, so
PATH: $PATH:/opt/bin reaches the sandbox unchanged; $${{ … }} escapes.
References cannot appear in field names or inside the args: block.name: or --name, the sandbox is named
<agent>-<workspace-basename>, so any two environments with the same agent
and the same workspace directory name collide — even in different parent
directories. Give each environment an explicit name: when that can
happen. If you pass --name, pass the same value to every sbx env
command for that environment.workspace: is the primary mount (read/write in bind mode); omitting it
mounts nothing, so an agent would start without the project. The object
form {path: ., clone: true} mounts the path read-only and runs the agent
on a private clone (--clone/--clone=false override it per
invocation). additionalWorkspaces: require a primary workspace:.sbxenv.yaml outside every directory you mount — the
primary workspace and each additionalWorkspaces entry — for example beside
the project directory with workspace: ./web-app. The file decides which
lifecycle, secret, and MCP commands run on the host, so the agent must not
be able to change it.sbx mounts env files read-only by default, but a file in a
subdirectory can still be replaced: the sandbox renames the writable
parent directory and recreates the path. sbx env plan calls this out;
never claim the rename creates no gap. (One sbx v0.51.0 macOS test refused
that rename — see checks/runtime-results.md — but the plan and docs
still treat the file as unprotected, so do not rely on it.)sandboxOptions.writableEnvFiles: true lets the sandbox write its own env
files (local only). It is a deliberate security downgrade the plan reports;
use it only when the agent is meant to change what future invocations run
on the host.args: — parameterizing a shared filedefault or required: true, plus
optional description and either enum or pattern (RE2, whole value).--env-arg NAME=VALUE or --env-args-file FILE; the
host environment is never read. An undeclared reference, missing required
value, unknown supplied name, or failed enum/pattern is an error.cpus: ${{ env.args.cpus }} becomes an integer); quote it to keep a string.args:.secrets: and registries: provision into the same credential store as
sbx secret set, at this sandbox's scope, so sbx env rm removes them.
Each source sets exactly one of value/ref/command; see
docker-sandboxes-network-credentials for runtime semantics.command: sources run on the host from a fresh temporary directory
and run whenever the secret is needed, even with --skip-host-commands.
Use absolute helper paths and keep helpers outside writable mounts.bindings: merge into the user's global credentials.yaml and survive
sbx env rm unless --prune-bindings is passed — which deletes the whole
global entry for each declared service, possibly affecting other sandboxes.
Bind only the mechanism (apiKey or oauth) the user will actually use.value: appears only as a sha256: digest in the plan and state,
but the file itself still holds the plaintext. Use ref: or command:;
the plan shows where such a secret comes from, never its resolved value.
# OPTIONAL fragment — add only if this environment needs the credential.
secrets:
anthropic:
ref: op://Private/Anthropic/api-key # never a literal `value:`
refresh: 55m
lifecycle: — host commandsworkdir: is
set. Within a phase they run in order and stop at the first failure. They
receive SBX_LIFECYCLE_PHASE, SBX_ENV_FILE(S), SBX_ENV_DIR,
SBX_SANDBOX_NAME, SBX_AGENT, and SBX_WORKSPACE, but not the file's
env: values or resolved secrets.
initialize — before anything else, on every create and run,
including a run that attaches to an existing sandbox. It must be
idempotent.postCreate — once, after a new sandbox is created and before
attachment; not on reattach.preRemove — after removal is approved, before deletion. A failure is
only a warning. Afterwards sbx rebuilds the destroy plan and stops if the
commands introduced changes the approval did not cover.lifecycle:
initialize:
- command: test -d app || git clone https://github.com/acme/app
postCreate:
- command: ./scripts/seed-fixtures.sh
lifecycle only for host-side
preparation and teardown.sbx env plan [PATH...] prints what applying would change outside the
sandbox — host commands, credentials, bindings, MCP registrations,
directories, kits, ports, options, and variables — compared with what was
last applied and approved. It changes, approves, and records nothing.
It also does not resolve kit references: an invented kit or a missing tag
plans cleanly. describe every OCI reference at the exact tag you write
before trusting a clean plan.
Margin symbols: + add, ~ change, - destroy, > run a host command
again, ! stop tracking without deleting.create, run, and rm show their plan and ask for approval. Interactive
approval is recorded; a later plan with no host commands applies silently
until something changes or a resource is missing.sbx settings set env.rememberHostCommands true asks again only
when the commands change — never enable it for commands you have not
reviewed.-f/--force approves one create/run without recording consent (on
rm it also deletes a sandbox in use). Use it for reviewed, trusted files
in automation only — never for untrusted pull-request content, because
the plan's host commands run with the runner's privileges.--skip-host-commands skips lifecycle commands and disables the
environment's local MCP commands until a later env run without it;
credential command sources still run.sbx env run reports a sandbox that "agrees with everything this
environment declares" but "nothing was done", its environment state was
lost. Rerun sbx env run interactively with the same paths and name and
confirm adoption only for the intended sandbox; --force never confirms
adoption, so automation needs this done interactively first.env exec and updating an existing environmentsbx env exec [PATH...] -- COMMAND runs no lifecycle commands for an
existing sandbox. If the sandbox is missing, it offers to create it only in
an interactive terminal (with the normal approval and lifecycle); with
non-interactive stdin or --no-input it fails (exit 125) — run
sbx env create first.sbx env run applies changed env values and
reconciles MCP servers, and entrypoint/cmd take effect on each run.
Changes to workspaces, kits, kit host mounts, ports, secrets, bindings, and
sandboxOptions apply only on the next creation: sbx env rm, then create
again.mounts:, ports:, mcp:, entrypoint/cmd, and sandboxOptions:These map onto kit host mounts, sbx ports --publish, MCP gateway
registrations, the agent launch argv, and sbx create options. Exact field
shapes, defaults, and what sbx env rm leaves behind for each are in
references/env-schema-fields.md.
sbx create/run/rm flag-based workflow this file wraps, use
docker-sandboxes-lifecycle.secrets:/registries:/bindings: mean at runtime, and for
network policy independent of any environment file, use
docker-sandboxes-network-credentials.kits: entry references, use docker-sandboxes-kits.references/authoring-workflow.md — step-by-step create and update
procedure, workspace-signal table, credential and host-grant handling, and
the final checklist.references/env-schema-fields.md — every top-level field, its shape and
defaults, with YAML examples.references/sources.md — provenance for the rules above.assets/sbxenv.yaml — a complete, minimal, safe example: a shell agent
mounting the declaring file's own directory, one static env var, and no
credentials — it validates and plans without onboarding authentication.
It sits at its mount root; for real projects prefer a file outside the
mounts.scripts/kits.py — live Docker Hub kit search, descriptor summary,
version-ordered update, and digest pinning for kits: entries. Run with
python3 -I; it only reads public registries.checks/verification.md — verification runbook for the helper and
sbx env behavior (run manually with an isolated, uniquely named
--app-name signed in for the run, never with real secret values or
untrusted lifecycle commands force-approved).checks/runtime-results.md — recorded results of that runbook on sbx
v0.51.0 (macOS arm64), including what the plan does not check.Use this skill when creating, updating, reviewing, planning, or running a declarative `sbxenv.yaml` file for Docker Sandboxes (`sbx env plan/create/run/exec/rm`), even if the user just says "check in
---name: docker-sandboxes-envdescription: Use this skill when creating, updating, reviewing, planning, or running a declarative `sbxenv.yaml` file for…---# skills/docker-sandboxes-env/SKILL.mdภาพรวม
Use this skill when creating, updating, reviewing, planning, or running a declarative `sbxenv.yaml` file for Docker Sandboxes (`sbx env plan/create/run/exec/rm`), even if the user just says "check in a sandbox config", "set up this project for sbx env", "which kits should this project's sbxenv use", "bump or pin the kits in my sbxenv", or "run a setup script before the agent starts". Covers composing an agent workload and v3 mixin kits chosen from the live Docker Hub catalog with the bundled `scripts/kits.py` helper, kit and environment `args`, secrets/registries/bindings, workspace and mounts, `entrypoint`/`cmd`, ports, MCP servers, `sandboxOptions` (including `writableEnvFiles`), host `lifecycle` commands and the approval plan, multi-file merge, and the `~/.sbxenv.yaml` user defaults.
FAQ
ดาวน์โหลด skills/docker-sandboxes-env/SKILL.md จากผู้เผยแพร่ หรือคัดลอกพาธแล้วเปิดรีโพซิทอรี PlugMCP แสดงรายการสกิลเท่านั้น ไม่ได้โฮสต์ไฟล์
ผู้เผยแพร่เก็บไว้ที่ https://github.com/docker/skills
Claude, Cursor, Codex และ Grok Build อ่าน SKILL.md ที่คุณเพิ่มจากรีโพซิทอรีของผู้เผยแพร่ได้ ส่วน Grok Bot จะติดตั้งให้เมื่อคุณส่งลิงก์โฟลเดอร์ GitHub ของสกิลในแชต