Images
By default, when spinning up a Sandbox, Daytona uses a simple image with some useful utilities pre-installed, such as python
, node
, pip
as well as some common pip packages. More information below.
It is possible to use custom images by visiting the Dashboard, clicking on Images and on Create Image
. If your image hasn’t got a long-running entrypoint, Daytona will ensure sure that the resulting container won’t exit immediately upon creation by adding its own sleep infinity
entrypoint.
Once the image is pulled, validated and has an Active
state, it is ready to be used. Define the CreateSandboxParams
object to specify the custom image to use:
params = CreateSandboxParams(image="alpine/3.21", language="python")sandbox = daytona.create(params)
const sandbox = await daytona.create({ language: 'python', image: 'alpine/3.21',})
Full example:
from daytona_sdk import Daytona, CreateSandboxParams
daytona = Daytona()
sandbox = daytona.create(CreateSandboxParams(image="alpine/3.21", language="python"))
response = sandbox.process.code_run('print("Sum of 3 and 4 is " + str(3 + 4))')if response.exit_code != 0: print(f"Error running code: {response.exit_code} {response.result}")else: print(response.result)
daytona.remove(sandbox)
import { Daytona } from '@daytonaio/sdk'
async function main() { // Initialize the Daytona client const daytona = new Daytona()
try { // Create the Sandbox instance const sandbox = await daytona.create({ language: 'python', image: 'alpine/3.21', }) // Run the code securely inside the Sandbox const response = await sandbox.process.codeRun( 'print("Sum of 3 and 4 is " + str(3 + 4))', ) if (response.exitCode !== 0) { console.error('Error running code:', response.exitCode, response.result) } else { console.log(response.result) } } catch (error) { console.error('Sandbox flow error:', error) } finally { // Clean up the Sandbox await daytona.remove(sandbox) }}
main()
Custom Container Registries
If you want to use a private image, go to Dashboard -> Registries -> Add Registry and input the necessary fields. Once the Container Registry is created, you may go back to the Images page and add images from the newly created registry.
The next step is the same; simply set the CreateSandboxParams
field to use the full image name and no more authentication is needed.
Using a Local Image
In order to avoid having to manually set up a private container registry and push your image there, the Daytona CLI allows you to push an image from your local device or from a local Dockerfile and use it in your Sandboxes.
After running docker images
and ensuring the image and tag you want to use is available use the daytona image push
command to add the image to Daytona, e.g.:
daytona image push custom-alpine:3.21
If you haven’t built the desired image yet, you can use the --dockerfile
flag to pass the path to the Dockerfile you want to use and let the CLI do the rest:
daytona image push --dockerfile ./Dockerfile
Building image from /Users/idagelic/docs/DockerfileStep 1/5 : FROM alpine:latest
...
Successfully pushed dfile-try:0.1.0 to Daytona
⡿ Waiting for the image be validated ...
...
✓ Use 'harbor-transient.internal.daytona.app/daytona/dfile-try:0.1.0' to create a new sandbox using this image
This approach also ensures that the resulting image is for the AMD architecture which is the architecture we use when spinning up Daytona Sandboxes.
Default Sandbox Image
The default image used by Daytona contains python
, node
and their respective LSP’s, as well as these pre-installed pip
packages:
beautifulsoup4
(v4.13.3)django
(v5.1.7)flask
(v3.1.0)keras
(v3.9.0)matplotlib
(v3.10.1)numpy
(v2.2.3)openai
(v1.65.4)opencv-python
(v4.11.0.86)pandas
(v2.2.3)pillow
(v11.1.0)pydantic-ai
(v0.0.35)requests
(v2.32.3)scikit-learn
(v1.6.1)scipy
(v1.15.2)seaborn
(v0.13.2)SQLAlchemy
(v2.0.38)transformers
(v4.49.0)anthropic
(v0.49.0)daytona_sdk
(v0.11.1)huggingface
(v0.0.1)instructor
(v1.7.3)langchain
(v0.3.20)llama-index
(v0.12.22)ollama
(v0.4.7)