Skip to content

Commit 48a88ec

Browse files
authored
Add build_id reference to tags documentation (#144)
1 parent ed03806 commit 48a88ec

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/template/tags.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,38 @@ sandbox2 = Sandbox.create('my-template:default')
3939

4040
</CodeGroup>
4141

42+
## Referencing a specific build
43+
44+
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.
45+
46+
The format follows the same colon syntax as tags: `<template>:<build_id>` or `<namespace>/<template>:<build_id>`.
47+
48+
You can find the `build_id` from the return value of `Template.build()` or by listing tags with `Template.getTags()` / `Template.get_tags()`.
49+
50+
<CodeGroup>
51+
52+
```typescript JavaScript & TypeScript
53+
import { Sandbox } from 'e2b'
54+
55+
// Start a sandbox from a specific build ID
56+
const sandbox = await Sandbox.create('my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
57+
58+
// With namespace
59+
const sandbox2 = await Sandbox.create('acme/my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
60+
```
61+
62+
```python Python
63+
from e2b import Sandbox
64+
65+
# Start a sandbox from a specific build ID
66+
sandbox = Sandbox.create('my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
67+
68+
# With namespace
69+
sandbox2 = Sandbox.create('acme/my-template:f47ac10b-58cc-4372-a567-0e02b2c3d479')
70+
```
71+
72+
</CodeGroup>
73+
4274
## Building with tags
4375

4476
You can build templates with one or more tags to create versioned builds.

0 commit comments

Comments
 (0)