Docker Deployment & Infrastructure
Relevant source files
The following files were used as context for generating this wiki page:
Daytona's infrastructure is built upon a containerized architecture designed to provide isolated, reproducible development environments (sandboxes). The system utilizes Docker Compose for local development orchestration and leverages specialized Docker images to maintain consistency across various programming language SDKs (TypeScript, Ruby, Python).
The infrastructure encompasses core application services, database persistence, object storage, and specialized plugins like ComputerUse for VNC-based desktop environments. It also includes integrated OIDC authentication through Auth0 and private Docker registry management for secure image handling.
Sources: docker/README.md:1-25, libs/computer-use/README.md:1-15
Local Infrastructure Orchestration
Daytona provides a comprehensive Docker Compose setup for local development. This environment orchestrates multiple microservices that handle everything from API management to distributed tracing.
Core Services
The local deployment includes the following key components:
| Service | Description |
|---|---|
| API | The main Daytona application server. |
| Proxy | Request proxy service for routing. |
| Runner | Hosts the Daytona Runner service. |
| SSH Gateway | Handles secure SSH access to sandboxes. |
| Registry | Docker image registry with a web UI. |
| MinIO | S3-compatible object storage for persistence. |
| Dex/Auth0 | Identity and OIDC authentication providers. |
| Jaeger | Distributed tracing for system observability. |
Sources: docker/README.md:7-22
Service Communication Flow
The architecture relies on shared networking for simplified communication between services. Local DNS resolution for *.proxy.localhost is required to allow the SDK and direct proxy access to function correctly.
The diagram shows how user requests flow through the proxy to the API, which coordinates with the Runner to manage sandboxes and data persistence. Sources: docker/README.md:12-40
Sandbox Image Architecture
Daytona defines sandbox environments through dynamic Dockerfile generation within its SDKs. This allows developers to programmatically define the operating system, language versions, and dependencies of their development environments.
Image Definition and Construction
The system uses static factory methods to create standard images, such as Image.debian_slim() or Image.base(). These classes manage a dockerfile string and a contextList to track local files that need to be copied into the container.
This diagram represents the class structure used in the SDKs to build environment definitions. Sources: libs/sdk-typescript/src/Image.ts:60-80, libs/sdk-ruby/lib/daytona/common/image.rb:30-50
Debian Slim Environment
The standard debian_slim environment is based on the official Python images. It initializes with essential build tools to support common development workflows.
- Base Image:
python:{version}-slim-bookworm - Default Packages:
gcc,gfortran,build-essential - Configuration: Non-interactive frontend to prevent blocking during automated builds.
Sources: libs/sdk-typescript/src/Image.ts:355-375, libs/sdk-ruby/lib/daytona/common/image.rb:245-265
Specialized Service Infrastructure
ComputerUse (VNC Environment)
For environments requiring a desktop interface, Daytona utilizes the ComputerUse plugin. This system manages a specific process hierarchy within the container to provide a web-based VNC experience.
The processes must start in this specific order to ensure the display and desktop environment are available before the VNC server attempts to expose them. Sources: libs/computer-use/README.md:10-25
Registry Management
Daytona supports managing Docker registries through its API. This includes internal, organization-wide, and transient registries used for snapshotting.
| Field | Type | Description |
|---|---|---|
name | String | Identifier for the registry. |
url | String | The remote URL of the Docker registry. |
registry_type | Enum | internal, organization, transient, or backup. |
is_default | Boolean | Whether this registry is the primary choice for the organization. |
Sources: libs/api-client-ruby/lib/daytona_api_client/models/create_docker_registry.rb:20-50, libs/api-client-python/daytona_api_client/models/docker_registry.py:25-40
CI/CD and Container Build System
The project uses nx and specialized scripts to manage the building and distribution of its infrastructure components.
- Multi-Platform Support: Build targets are defined for both
linux/amd64andlinux/arm64. - Caching: Utilizes remote registry-based build caching (
type=registry) to speed up CI pipelines. - Versioning: Versions are injected during build time via
-ldflagsfor Go applications like the Runner.
Sources: nx.json:110-150, apps/runner/project.json:60-80
Summary
The Daytona Docker Deployment & Infrastructure provides a modular and isolated framework for development environments. By combining a microservices-based local orchestration (Docker Compose) with a flexible SDK-driven image construction system, Daytona ensures that sandboxes are consistent across different platforms and extensible through specialized plugins like VNC-based desktop environments. The infrastructure is further solidified by integrated authentication, S3 storage, and automated multi-platform build pipelines.