E2B Templates do not map 1:1 to Dockerfiles. Only a limited set of methods are supported and converted to equivalent Docker instructions.See Compatibility for more details.
Example
Create a template file:template.ts
dev.ts
Compatibility
- TypeScript
- Python
| Method | Supported | Docker Equivalent |
|---|---|---|
fromBaseImage() | FROM e2bdev/base | |
fromUbuntuImage() | FROM ubuntu:version | |
fromNodeImage() | FROM node:version | |
fromPythonImage() | FROM python:version | |
fromDebianImage() | FROM debian:version | |
fromImage() | FROM custom-image | |
setEnvs() | ENV key=value | |
runCmd() | RUN command | |
setStartCmd() | ENTRYPOINT command | |
setWorkdir() | WORKDIR path | |
setUser() | USER user | |
copy() | COPY src dest | |
aptInstall() | RUN apt-get update && apt-get install -y package | |
pipInstall() | RUN pip install package | |
npmInstall() | RUN npm install package | |
gitClone() | RUN git clone repository | |
makeSymlink() | RUN ln -s src dest | |
fromTemplate() | Not supported - templates based on other templates cannot be converted to Dockerfile | |
fromDockerfile() | Not supported - parsing Dockerfiles is not supported for local development | |
fromRegistry() | Not supported - registry authentication not supported for local development | |
fromAWSRegistry() | Not supported - AWS registry authentication not supported for local development | |
fromGCPRegistry() | Not supported - GCP registry authentication not supported for local development | |
skipCache() | Not supported - cache invalidation is not applicable for Dockerfile conversion | |
setReadyCmd() | Not supported - ready commands are E2B-specific and not part of Docker |