Samples
Samples are quick-start repositories with predefined development configurations, environments, and dependencies used to create Workspaces.
Custom Samples
Daytona provides an option to use custom Samples to create Workspaces. Creating custom Samples is a two-step process that involves:
-
A repository containing the Sample code and a
devcontainer.json
file defining the development environment. -
Samples Index (
index.json
) file serving as a registry of available Samples for creating Workspaces.
Sample Repository
Custom Sample repository is a Git repository that contains the Sample code and a devcontainer.json
file that defines the development environment. The repository serves as the core content of the Sample and is used to create a Workspace.
-
Create a repository representing the custom Sample.
-
Define the custom Sample code, development configurations and dependencies.
-
Create a
devcontainer.json
file that defines the development environment.
- Use the development container standard to define your development environment. Development containers vary based on the programming language, configurations, and tools used within the Sample.
Example of a devcontainer.json
file for development environment using Go programming language:
-
Host the Sample repository on a Git repository or another platform.
-
Add Sample properties to the Samples Index.
Sample will be used to create a Workspace by cloning the repository and using the devcontainer.json
file to define the development environment.
Samples Index
Samples require a Sample Index (index.json
) file that serves as a registry of available Samples for creating Workspaces. The Samples Index is used to display the available Samples when creating a Workspace.
-
Create an
index.json
file representing the Samples Index. -
Define an array of JSON objects representing the Samples.
Each JSON object in the array represents a Sample:
-
name
Name of the Sample.
-
gitUrl
Link to the publicly available Sample repository.
-
Host the
index.json
file publicly on a Git repository or another platform. -
Run the following command to configure the Samples Index URL:
- Enter the public raw URL of the
index.json
file in theSamples Index URL
field.
- Restart the Daytona server to apply the changes.
Custom Samples will be available available when creating a Workspace. The chosen Sample will be cloned and used to create the Workspace.
Daytona Samples
Daytona provides a collection of default Samples with predefined development configurations, environments, and dependencies. Daytona Samples are available to choose from when creating a Workspace.
Daytona Samples are integrated via a Samples Index (index.json
) file that serves as a registry of available Daytona Samples for creating Workspaces.
The chosen Sample will be cloned and used to create the Workspace. The Daytona Sample repository will serve as the core content of the Sample used to create a Workspace.
View the list of available Daytona Samples in the Samples Index.