DaytonaDocs

Container Registries

Use private registry images by storing per-host credentials.

Sandboxes and snapshots can boot from images in private container registries — GitHub Container Registry, a private Docker Hub repository, Google Artifact Registry, Amazon ECR, or any registry that speaks basic auth. Daytona stores one credential per registry host per project. From then on, any image build or sandbox create that references an image on that host authenticates automatically; there is no per-create credential field to pass and nothing extra in your SDK code.

The host is derived from the image reference the same way Docker derives it: ghcr.io/acme/app:latest resolves to ghcr.io, while a bare reference like node:20 or library/ubuntu:22.04 resolves to Docker Hub. If the project has a credential stored for that host, the pull is authenticated; otherwise it proceeds anonymously.

Adding a registry credential

Store a credential with PUT /registries/:host (or PUT /registries with the host in the body). Registries are managed via REST and the Registries page in the dashboard.

Note: there is no SDK service for registries yet — use REST or the dashboard. Once the credential is stored, SDK sandbox creates that reference the host authenticate automatically.

FieldRequiredDefaultNotes
kindnobasicOne of basic, ghcr, gcr, ecr
usernameyesRegistry username (see recipes below)
passwordyesPassword or token; write-only, max 64 KiB
descriptionnoFree-form note

Rules the API enforces:

  • Host format. The host must be a bare host[:port] — no scheme, path, or trailing slash. Hosts are lowercased, and Docker Hub aliases (docker.io, registry-1.docker.io, registry.hub.docker.com) all normalize to the canonical index.docker.io, so looking up or deleting docker.io finds the same credential.
  • Kind/host cross-validation. A misconfigured credential fails at write time rather than silently at pull time: ghcr requires host ghcr.io; gcr requires gcr.io, *.gcr.io, pkg.dev, or a *-docker.pkg.dev host; ecr requires an *.dkr.ecr.<region>.amazonaws.com host. basic works with any host.
  • Write-only passwords. Passwords are encrypted at rest and never returned by any endpoint. Updating a credential replaces it in place (the PUT is an upsert and returns 204).

Recipes

GitHub Container Registry (GHCR). Use your GitHub username and a personal access token with the read:packages scope as the password:

cURL
curl -X PUT https://api.rl.trydaytona.com/registries/ghcr.io \
  -H "Authorization: Bearer $RLP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "ghcr",
    "username": "my-github-user",
    "password": "ghp_XXXXXXXXXXXXXXXX",
    "description": "GHCR read token for acme images"
  }'

Private Docker Hub. Use your Docker Hub username and an access token (or password). Any Docker Hub alias works as the host — it is stored under index.docker.io:

cURL
curl -X PUT https://api.rl.trydaytona.com/registries/docker.io \
  -H "Authorization: Bearer $RLP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "acme-ci",
    "password": "dckr_pat_XXXXXXXX",
    "description": "Docker Hub private repos"
  }'

Once stored, private images from that host just work — for example creating a sandbox from a private GHCR image:

Python
from rlp import CreateSandboxFromImageParams, Daytona
 
daytona = Daytona()
sandbox = daytona.create(CreateSandboxFromImageParams(
    image="ghcr.io/acme/private-runtime:latest",
))
TypeScript
const sandbox = await daytona.create({
  image: 'ghcr.io/acme/private-runtime:latest',
})

The same applies to snapshot builds whose base image lives on a credentialed host.

Managing credentials

Listing and fetching return metadata only — host, kind, username, description, and last update time — never the password. Deletion is idempotent and returns 204.

cURL
# List all registry credentials for the project (metadata only)
curl https://api.rl.trydaytona.com/registries \
  -H "Authorization: Bearer $RLP_API_KEY"
 
# Inspect one host
curl https://api.rl.trydaytona.com/registries/ghcr.io \
  -H "Authorization: Bearer $RLP_API_KEY"
 
# Remove a credential
curl -X DELETE https://api.rl.trydaytona.com/registries/ghcr.io \
  -H "Authorization: Bearer $RLP_API_KEY"

To rotate a credential, simply PUT the same host again with the new password — subsequent pulls use the new value.

See also

  • Image sources — how image references are resolved when creating sandboxes.
  • Secrets — the related mechanism for API keys and other credentials your code needs.

On this page