Feature: export template/sandbox rootfs as Docker image
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Add a way to export an e2b template (or paused sandbox) rootfs as an OCI/Docker
image, so the environment can be used as a base for new Docker builds or migrated
to other container runtimes without requiring e2b infrastructure.
Motivation
Currently the only supported direction is:
Docker image → e2b template (via `oci.go` pull + ext4 conversion)
There is no supported path back. Users who have iterated on a sandbox
environment (installed packages, configured services, trained models, etc.)
cannot extract that state as a portable Docker image without manually mounting
the raw ext4 file, which requires root access to the orchestrator host.
Proposed API
A new CLI command (or API endpoint):
e2b template export <templateId> --output my-image:latest
# or
e2b template export <templateId> --tar ./rootfs.tar
What it should do
- Retrieve the template's
rootfs.ext4from storage. - Mount it and pack the filesystem into an OCI image (using
go-containerregistry— already a transitive dependency via the build path). - Optionally strip e2b-specific services (
envd, init scripts) so the result
is a clean base image. - Push to a registry or write a local
.tarthatdocker loadcan consume.
What it cannot do
The memory snapshot (memfile) has no Docker equivalent — exported images
capture disk state only, not in-flight process memory.
Related
core/oci/oci.goalready pulls and unpacks OCI images into ext4 — the
inverse operation reuses the samego-containerregistryprimitives.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading core/oci/oci.go and tracing the existing OCI pull and ext4 conversion path, then review how template rootfs.ext4 is retrieved. Define whether the first implementation targets the CLI, an API endpoint, or both, and confirm the go-containerregistry capabilities. Done means disk state can be exported as a registry image or docker-load-compatible tar, with memory state explicitly excluded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100