Skip to content

Commit a8288fc

Browse files
committed
Add build_id reference option to tags documentation
1 parent ed03806 commit a8288fc

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

docs/template/tags.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,35 @@ stable_sandbox = Sandbox.create('my-tool:stable') # Tested
270270
```
271271

272272
</CodeGroup>
273+
274+
### Referencing a specific build
275+
276+
Instead of using a named tag, you can start a sandbox from a specific build by passing its `build_id` directly. This is useful when you need to pin a sandbox to an exact build artifact — for example, during debugging or when reproducing an issue from a known build.
277+
278+
The format follows the same colon syntax as tags: `<template>:<build_id>` or `<namespace>/<template>:<build_id>`.
279+
280+
You can find the `build_id` from the return value of `Template.build()` or by listing tags with `Template.getTags()` / `Template.get_tags()`.
281+
282+
<CodeGroup>
283+
284+
```typescript JavaScript & TypeScript
285+
import { Sandbox } from 'e2b'
286+
287+
// Start a sandbox from a specific build ID
288+
const sandbox = await Sandbox.create('my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
289+
290+
// With namespace
291+
const sandbox2 = await Sandbox.create('acme/my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
292+
```
293+
294+
```python Python
295+
from e2b import Sandbox
296+
297+
# Start a sandbox from a specific build ID
298+
sandbox = Sandbox.create('my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
299+
300+
# With namespace
301+
sandbox2 = Sandbox.create('acme/my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
302+
```
303+
304+
</CodeGroup>

0 commit comments

Comments
 (0)