Builders
Builders are responsible for creating a container image with everything you need to be productive. Daytona provides control over how the resulting Project environment is created, allowing you to choose your preferred method to pull in your project’s tools, dependencies, and configuration.
When creating a Workspace, you can choose between the following Builders during the Advanced Configuration step:
-
Daytona builds the Project image after auto-detecting the most appropriate Builder.
-
Daytona builds the Project image according to the Dev Container configuration located in the project.
-
Daytona builds the Project image using an image you specify.
-
Daytona creates the Project using the default base image.
Automatic Builder
Daytona can auto-detect the most appropriate Builder for your project. When choosing this option, Daytona uses the following logic to determine which Builder to use:
- Check if a Dev Container configuration is present at
.devcontainer.json
or.devcontainer/devcontainer.json
, relative to the repository root. - If present, use the Dev Container Builder.
- If not present, use the None Builder.
To use the Automatic Builder, set the --builder
flag value to auto
during the Workspace creation. This flag only applies when creating Workspaces with a single Project.
daytona create <REPO_URL> --builder=auto
Dev Container Builder
You can build the Project image using the Dev Container standard. The following option is available when using this Builder:
- Devcontainer file path
The path where the Dev Container configuration is located, relative to the repository root.
The default value is .devcontainer/devcontainer.json
.
To use the Dev Container Builder, set the --devcontainer-path
flag to the Dev Container configuration path within the repository during the Workspace creation. This flag only applies when creating Workspaces with a single Project.
daytona create <REPO_URL> --devcontainer-path=.devcontainer/devcontainer.json
Custom Image Builder
You can build the Project image by specifying a custom base container. The following options are accepted when using this Builder:
- Custom container image
The name of the base container image for the Project.
- Container user
The user to execute commands as during the image build process.
- Post start commands
Commands to execute once the Project is started.
- Environment variables
A list of environment variables in the format
KEY=VALUE
.
To use the Custom Image Builder, set both --custom-image
and --custom-image-user
flags during the Workspace creation. These flags only apply when creating Workspaces with a single Project.
daytona create <REPO_URL> --custom-image=daytona-workspace:latest --custom-image-user=daytona
None
Daytona can build a Project using the default base image.
Unless otherwise configured using daytona server configure
, the default base image is set to daytonaio/workspace-project
.
Setting a Custom Build Registry
You can set a custom build registry for images built by a Daytona builder. After an image is built, it will be uploaded to the configured container registry to speed up future Workspace creation for the same Project.
Prerequisite
- An account on an accessible container registry with permission to push/pull images.
- Execute the following command to configure the custom build registry:
daytona container-registry set
- Set the required options:
- Server URL
The full URL to your custom container registry.
- Username
The username Daytona should use to log in to the container registry.
- Password
The password for your container registry account.
- Press
Enter
to set the custom build registry. - Execute the following command to configure the server:
daytona server configure
- Press
Enter
until the “Builder Registry” section is highlighted.
Builder RegistryTo add options, add a container registry with 'daytona cr set'> Local registry managed by Daytona
- Select the custom registry configured previously using
Up
/Down
. - Press
Enter
until the command exits to save the configuration.