@@ -7,12 +7,13 @@ icon: "code"
77You can test Templates locally by converting them to a Docker-compatible container images that you can build and run locally.
88
99<Warning >
10- E2B Templates do not map 1:1 to Dockerfiles. Only a limited set of instructions are supported and converted to equivalent Docker instructions.
10+ E2B Templates do not map 1:1 to Dockerfiles. Only a limited set of methods are supported and converted to equivalent Docker instructions.
1111
12- Supported instructions:
13- ` FROM ` , ` COPY ` , ` ENV ` , ` RUN ` , ` WORKDIR ` , ` USER ` , ` ENTRYPOINT `
12+ See [ Compatibility] ( /template/local-development#compatibility ) for more details.
1413</Warning >
1514
15+ ## Example
16+
1617Create a template file:
1718
1819<CodeGroup dropdown >
@@ -88,3 +89,65 @@ Build a container image from the Dockerfile and run it locally:
8889docker build - t template .
8990docker run template
9091```
92+
93+ # # Compatibility
94+
95+ < Tabs>
96+ < Tab title=" TypeScript" >
97+ | Method | Supported | Docker Equivalent |
98+ | :-- - | :---- : | :-- - |
99+ | `fromBaseImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM e2bdev/ base` |
100+ | `fromUbuntuImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM ubuntu:version` |
101+ | `fromNodeImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM node:version` |
102+ | `fromPythonImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM python:version` |
103+ | `fromDebianImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM debian:version` |
104+ | `fromImage()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM custom- image` |
105+ | `setEnvs()` | < Icon icon=" square-check" iconType=" solid" / > | `ENV key=value` |
106+ | `runCmd()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN command` |
107+ | `setStartCmd()` | < Icon icon=" square-check" iconType=" solid" / > | `ENTRYPOINT command` |
108+ | `setWorkdir()` | < Icon icon=" square-check" iconType=" solid" / > | `WORKDIR path` |
109+ | `setUser()` | < Icon icon=" square-check" iconType=" solid" / > | `USER user` |
110+ | `copy()` | < Icon icon=" square-check" iconType=" solid" / > | `COPY src dest` |
111+ | `aptInstall()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN apt- get update && apt- get install - y package` |
112+ | `pipInstall()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN pip install package` |
113+ | `npmInstall()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN npm install package` |
114+ | `gitClone()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN git clone repository` |
115+ | `makeSymlink()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN ln - s src dest` |
116+ | `fromTemplate()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - templates based on other templates cannot be converted to Dockerfile |
117+ | `fromDockerfile()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - parsing Dockerfiles is not supported for local development |
118+ | `fromRegistry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - registry authentication not supported for local development |
119+ | `fromAWSRegistry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - AWS registry authentication not supported for local development |
120+ | `fromGCPRegistry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - GCP registry authentication not supported for local development |
121+ | `skipCache()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - cache invalidation is not applicable for Dockerfile conversion |
122+ | `setReadyCmd()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - ready commands are E2B - specific and not part of Docker |
123+
124+ < / Tab>
125+ < Tab title=" Python" >
126+ | Method | Supported | Docker Equivalent |
127+ | :-- - | :---- : | :-- - |
128+ | `from_base_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM e2bdev/ base` |
129+ | `from_ubuntu_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM ubuntu:version` |
130+ | `from_node_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM node:version` |
131+ | `from_python_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM python:version` |
132+ | `from_debian_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM debian:version` |
133+ | `from_image()` | < Icon icon=" square-check" iconType=" solid" / > | `FROM custom- image` |
134+ | `set_envs()` | < Icon icon=" square-check" iconType=" solid" / > | `ENV key=value` |
135+ | `run_cmd()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN command` |
136+ | `set_start_cmd()` | < Icon icon=" square-check" iconType=" solid" / > | `ENTRYPOINT command` |
137+ | `set_workdir()` | < Icon icon=" square-check" iconType=" solid" / > | `WORKDIR path` |
138+ | `set_user()` | < Icon icon=" square-check" iconType=" solid" / > | `USER user` |
139+ | `copy()` | < Icon icon=" square-check" iconType=" solid" / > | `COPY src dest` |
140+ | `apt_install()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN apt- get update && apt- get install - y package` |
141+ | `pip_install()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN pip install package` |
142+ | `npm_install()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN npm install package` |
143+ | `git_clone()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN git clone repository` |
144+ | `make_symlink()` | < Icon icon=" square-check" iconType=" solid" / > | `RUN ln - s src dest` |
145+ | `from_template()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - templates based on other templates cannot be converted to Dockerfile |
146+ | `from_dockerfile()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - parsing Dockerfiles is not supported for local development |
147+ | `from_registry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - registry authentication not supported for local development |
148+ | `from_aws_registry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - AWS registry authentication not supported for local development |
149+ | `from_gcp_registry()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - GCP registry authentication not supported for local development |
150+ | `skip_cache()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - cache invalidation is not applicable for Dockerfile conversion |
151+ | `set_ready_cmd()` | < Icon icon=" square-xmark" iconType=" solid" / > | Not supported - ready commands are E2B - specific and not part of Docker |
152+ < / Tab>
153+ < / Tabs>
0 commit comments