Quick Start
How It Works
Docker compute provides isolated, reproducible execution environments with custom package management.Container Management
Provisioning Containers
Executing Commands
Container Lifecycle
LLM Integration
Common Patterns
Data Processing Pipeline
Web Scraping Environment
Development Environment
Configuration Options
Compute Configuration
| Option | Type | Default | Description |
|---|---|---|---|
image | str | "python:3.12-slim" | Docker base image |
packages | List[str] | [] | Python packages to install |
environment | Dict[str, str] | {} | Environment variables |
working_dir | str | "/workspace" | Container working directory |
Supported Images
| Image | Use Case | Pre-installed |
|---|---|---|
python:3.12-slim | Python development | Python 3.12, pip |
node:18-slim | JavaScript/Node.js | Node.js 18, npm |
ubuntu:22.04 | General Linux | Basic Linux utilities |
python:3.12-alpine | Minimal Python | Python 3.12 (smaller size) |
Best Practices
Choose Appropriate Base Images
Choose Appropriate Base Images
Use slim images for faster startup. Alpine images for minimal size. Full images when you need system packages and compilation tools.
Package Management
Package Management
Install packages during provisioning rather than runtime. Cache heavy dependencies by using custom Docker images for repeated use.
Resource Management
Resource Management
Always call
shutdown_compute() when done to free container resources. Monitor container resource usage for long-running tasks.Security Considerations
Security Considerations
Containers provide isolation but share the Docker daemon. Don’t run untrusted code without additional sandboxing measures.
Related
Managed Agents
Overview of managed agent concepts
E2B Cloud
Cloud-based sandboxed execution

