Skip to content

Commit 9468b19

Browse files
authored
Merge pull request #24167 from dvdksn/sandboxes-v0.12-followups
sandboxes v0.12 followups
2 parents f4969a3 + f278dbf commit 9468b19

File tree

9 files changed

+47
-23
lines changed

9 files changed

+47
-23
lines changed

content/manuals/ai/sandboxes/agents/opencode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords: docker, sandboxes, opencode, ai agent, multi-provider, authentication,
77
weight: 50
88
---
99

10-
{{< summary-bar feature_name="Docker Sandboxes" >}}
10+
{{< summary-bar feature_name="Docker Sandboxes v0.12" >}}
1111

1212
This guide covers authentication, configuration, and usage of OpenCode in a
1313
sandboxed environment.

content/manuals/ai/sandboxes/agents/shell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords: docker, sandboxes, shell, custom, manual setup, development environmen
77
weight: 80
88
---
99

10-
{{< summary-bar feature_name="Docker Sandboxes" >}}
10+
{{< summary-bar feature_name="Docker Sandboxes v0.12" >}}
1111

1212
This guide covers the Shell sandbox, a minimal environment for custom agent
1313
installation and development. Unlike other agent sandboxes, Shell doesn't

content/manuals/ai/sandboxes/get-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Follow these steps to run a sandbox with Claude Code:
4646
2. Restart Docker Desktop so the daemon picks up the new environment variable.
4747

4848
Alternatively, you can skip this step and authenticate interactively when
49-
Claude Code starts. If no credentials are found, you'll be prompted to log
50-
in. Note that interactive authentication requires you to authenticate for
51-
each workspace separately.
49+
Claude Code starts. Interactive authentication is less secure and requires
50+
you to re-authenticate for each workspace. See
51+
[Credential security](workflows.md#credential-security) for details.
5252

5353
2. Create and run a sandbox for Claude Code for your workspace:
5454

content/manuals/ai/sandboxes/migration.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,13 @@ template.
120120
4. Create a new sandbox with your template:
121121

122122
```console
123-
$ docker sandbox create --template my-sandbox-template:v1 \
124-
--pull-template=never \
125-
claude ~/project
123+
$ docker sandbox create --template my-sandbox-template:v1 claude ~/project
126124
```
127125

128126
> [!NOTE]
129127
> The `--pull-template` flag was introduced in Docker Desktop 4.61 (Sandbox
130-
> version 0.12). For Docker Desktop 4.58–4.60, substitute
131-
> `--pull-template=never` with `--load-local-template`.
128+
> version 0.12). On Docker Desktop 4.58–4.60, use `--load-local-template`
129+
> to use a locally-built template image.
132130
133131
5. Run the sandbox:
134132

content/manuals/ai/sandboxes/templates.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ $ docker build -t my-template:v1 .
6868
Use it directly from your local Docker daemon:
6969

7070
```console
71-
$ docker sandbox run --pull-template never -t my-template:v1 claude [PATH]
71+
$ docker sandbox run -t my-template:v1 claude [PATH]
7272
```
7373

74-
The `--pull-template never` flag tells the sandbox to use local template
75-
images.
74+
The default `--pull-template missing` policy finds the image in your local
75+
Docker daemon without pulling from a registry.
7676

7777
To share the template with others, push it to a registry:
7878

@@ -92,19 +92,20 @@ Docker Sandboxes caches template images to speed up sandbox creation. The
9292

9393
- `--pull-template missing` (default)
9494

95-
Pull the image only if it's not already cached locally. First sandbox
96-
creation automatically pulls the image, and subsequent sandboxes are created
97-
quickly because the image is cached.
95+
Use the local image if present, otherwise pull from the registry. Works for
96+
both locally-built images and registry images. On first use, registry images
97+
are pulled and cached; subsequent sandboxes reuse the cache.
9898

9999
- `--pull-template always`
100100

101-
Always pull the image from the registry before creating the sandbox, even if
102-
it's cached. Slower than `missing` but guarantees freshness.
101+
Always pull the latest image from the registry and update the host cache.
102+
The VM uses the refreshed cache. Slower than `missing` but guarantees the
103+
sandbox uses the latest version. Requires a registry image.
103104

104105
- `--pull-template never`
105106

106-
Use only cached images. Never pull from a registry. Fails if the image isn't
107-
in the cache.
107+
Never use the host cache. The sandbox VM pulls the image directly from the
108+
registry on every startup. Requires a registry image.
108109

109110
The cache stores template images separately from your host Docker daemon's
110111
images. Cached images persist across sandbox creation and deletion, but are
@@ -130,11 +131,11 @@ $ docker sandbox save claude-project my-template:v1
130131
✓ Saved sandbox as my-template:v1
131132
```
132133

133-
This saves the image to your local Docker daemon. Use `--pull-template never`
134-
to create new sandboxes from it:
134+
This saves the image to your local Docker daemon. The default pull policy finds
135+
the image locally:
135136

136137
```console
137-
$ docker sandbox run --pull-template never -t my-template:v1 claude ~/other-project
138+
$ docker sandbox run -t my-template:v1 claude ~/other-project
138139
```
139140

140141
To save as a tar file instead (for example, to transfer to another machine):

content/manuals/ai/sandboxes/workflows.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ To preserve a configured environment, create a [Custom template](templates.md).
117117

118118
## Security considerations
119119

120+
### Credential security
121+
122+
Set API keys as environment variables on the host rather than authenticating
123+
interactively inside a sandbox. When you set credentials on the host, Docker
124+
Sandboxes proxies API calls from the sandbox through the host daemon, so the
125+
agent never has direct access to the raw key.
126+
127+
When you authenticate interactively, credentials are stored inside the sandbox
128+
where the agent can read them directly. This creates a risk of credential
129+
exfiltration if the agent is compromised or behaves unexpectedly.
130+
131+
Interactive authentication also requires you to re-authenticate for each
132+
workspace separately.
133+
134+
### Workspace trust
135+
120136
Agents running in sandboxes automatically trust the workspace directory without
121137
prompting. This enables agents to work freely within the isolated environment.
122138

@@ -185,6 +201,8 @@ workspace files.
185201

186202
## Multiple workspaces
187203

204+
{{< summary-bar feature_name="Docker Sandboxes v0.12" >}}
205+
188206
Mount multiple directories into a single sandbox for working with related
189207
projects or when the agent needs access to documentation and shared libraries.
190208

content/reference/cli/docker/sandbox/create/opencode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ datafile: docker_sandbox_create_opencode
44
title: docker sandbox create opencode
55
layout: cli
66
---
7+
8+
{{< summary-bar feature_name="Docker Sandboxes v0.12" >}}

content/reference/cli/docker/sandbox/create/shell.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ datafile: docker_sandbox_create_shell
44
title: docker sandbox create shell
55
layout: cli
66
---
7+
8+
{{< summary-bar feature_name="Docker Sandboxes v0.12" >}}

data/summary.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ Docker Projects:
192192
Docker Sandboxes:
193193
availability: Experimental
194194
requires: Docker Desktop [4.58](/manuals/desktop/release-notes.md#4580) or later
195+
Docker Sandboxes v0.12:
196+
availability: Experimental
197+
requires: Docker Desktop [4.61](/manuals/desktop/release-notes.md#4610) or later
195198
Docker Scout exceptions:
196199
availability: Experimental
197200
requires: Docker Scout CLI [1.15.0](/manuals/scout/release-notes/cli.md#1150) and later

0 commit comments

Comments
 (0)