Serialization
The e2b lexicon writes each Template as a Dockerfile named after the template, so several can share a directory, and indexes them with the command that builds each one.
Building
Section titled “Building”e2b.<name>.Dockerfile starts FROM the template’s fromImage. Each env entry becomes an ENV line and each run step a RUN line, in order, with WORKDIR between them when workdir is set:
FROM node:22-bookwormENV CI="1"RUN apt-get update && apt-get install -y --no-install-recommends jq && rm -rf /var/lib/apt/lists/*The primary output is a JSON index of the templates, keyed by the name each was exported as. build is the e2b template create command line for the template. It names the Dockerfile and passes --cmd, --ready-cmd, --cpu-count and --memory-mb only when the declaration sets them:
{ "templates": { "steward": { "name": "chant-steward", "dockerfile": "e2b.chant-steward.Dockerfile", "build": "e2b template create chant-steward --dockerfile e2b.chant-steward.Dockerfile --cpu-count 2 --memory-mb 2048", "cpuCount": 2, "memoryMB": 2048 } }}A project that declares no template gets { "templates": {} }.
Applying
Section titled “Applying”chant does not build templates. Run each template’s build command in the output directory, once, and again when the declaration changes. A profile’s template then names the template, and the next steward made from that profile starts from it. A steward that already exists keeps the sandbox it has; delete it to have the next run make a new one.