Sign Up

Image

Properties:

  • id string
  • name string | null
  • anonymous boolean
  • availableIn string[]
  • bytes? number | null
  • class ArtifactClass
  • createdAt string
  • error? string | null
  • expiresAt? string | null
  • layer_count? number | null
  • manifest_name? string | null
  • origin ImageOrigin
  • region string
  • retention ArtifactRetention
  • source? unknown
  • status ImageStatus
  • formatVersion? number
  • formatOutdated boolean

Constructors

Constructor

new Image(image: api.ImageListItem): Image;

Parameters:

  • image api.ImageListItem

Returns:

  • Image

ImageBuilder

Methods

cmd()

cmd(...args: readonly string[]): ImageBuilder;

Parameters:

  • ...args: readonly string[]

Returns:

  • ImageBuilder

entrypoint()

entrypoint(...args: readonly string[]): ImageBuilder;

Parameters:

  • ...args: readonly string[]

Returns:

  • ImageBuilder

env()

env(name: string, value: string): ImageBuilder;

Parameters:

  • name string
  • value string

Returns:

  • ImageBuilder

env()

env(values: Record<string, string>): ImageBuilder;

Parameters:

  • values Record<string, string>

Returns:

  • ImageBuilder

env()

env(nameOrValues: string | Record<string, string>, value?: string): ImageBuilder;

Parameters:

  • nameOrValues string | Record<string, string>
  • value? string

Returns:

  • ImageBuilder

fromDockerfile()

fromDockerfile(dockerfile: string): ImageBuilder;

Parameters:

  • dockerfile string

Returns:

  • ImageBuilder

fromRegistry()

fromRegistry(ref: string): ImageBuilder;

Parameters:

  • ref string

Returns:

  • ImageBuilder

pipInstall()

pipInstall(...packages: readonly string[]): ImageBuilder;

Parameters:

  • ...packages: readonly string[]

Returns:

  • ImageBuilder

runCommands()

runCommands(...commands: readonly string[]): ImageBuilder;

Parameters:

  • ...commands: readonly string[]

Returns:

  • ImageBuilder

toDockerfile()

toDockerfile(): string;

Returns:

  • string

toRequestSource()

toRequestSource(): { source: NonNullable<api.CreateImageRequest["source"]> } | { dockerfile: string };

The POST /images source this builder describes (parity with Python's ImageBuilder.build_request_source): a bare registry ref with no steps is a registry IMPORT (source: {type: 'registry', ref} — pulled by the runner, no builder VM); anything else is a Dockerfile build. Sending a FROM ref Dockerfile for a plain ref made every images.pull and createFromBuild(ImageBuilder.fromRegistry(..)) spin up a builder VM (seen live on the PR #2008 preview).

Returns:

  • { source: NonNullable<api.CreateImageRequest["source"]> } | { dockerfile: string }

user()

user(name: string): ImageBuilder;

Parameters:

  • name string

Returns:

  • ImageBuilder

workdir()

workdir(path: string): ImageBuilder;

Parameters:

  • path string

Returns:

  • ImageBuilder

ImagesService

Constructors

Constructor

new ImagesService(
   http: AxiosInstance,
   control?: HttpTransport | HttpTransportConfig): ImagesService;

Parameters:

  • http AxiosInstance
  • control? HttpTransport | HttpTransportConfig

Returns:

  • ImagesService

Methods

build()

build(builder: ImageBuilder, options: BuildImageOptions = {}): Promise<Image>;

Parameters:

  • builder ImageBuilder
  • options BuildImageOptions = {}

Returns:

  • Promise<Image>

delete()

delete(imageId: string): Promise<void>;

Parameters:

  • imageId string

Returns:

  • Promise<void>

followBuildLogs()

followBuildLogs(
   imageId: string,
   options: BuildLogFollowOptions): Promise<BuildLogFollowResult>;

Parameters:

  • imageId string
  • options BuildLogFollowOptions

Returns:

  • Promise<BuildLogFollowResult>

get()

get(
   imageId: string,
   options: { wait?: 'ready'; timeout?: number } = {}): Promise<Image>;

Parameters:

  • imageId string
  • options { wait?: 'ready'; timeout?: number } = {}

Returns:

  • Promise<Image>

iter()

iter(
   options: { cursor?: string; limit?: number; name?: string; anonymous?: 'true' | 'false' | 'any'; sandboxId?: string } = {}): AsyncIterable<Image>;

Parameters:

  • options { cursor?: string; limit?: number; name?: string; anonymous?: 'true' | 'false' | 'any'; sandboxId?: string } = {}

Returns:

  • AsyncIterable<Image>

list()

list(
   options: { cursor?: string; limit?: number; name?: string; anonymous?: 'true' | 'false' | 'any'; sandboxId?: string } = {}): Promise<ListResult<Image>>;

Parameters:

  • options { cursor?: string; limit?: number; name?: string; anonymous?: 'true' | 'false' | 'any'; sandboxId?: string } = {}

Returns:

  • Promise<ListResult<Image>>

promote()

promote(imageId: string, name: string): Promise<Image>;

Name an ANONYMOUS image, making it permanent (PATCH /images/{id}). Promotion only: an image that already has a name answers 409 — renaming a named image is not offered (sandboxes reference images by id, so a rename would silently relabel every sandbox created from it).

Parameters:

  • imageId string
  • name string

Returns:

  • Promise<Image>

pull()

pull(ref: string, options: BuildImageOptions = {}): Promise<Image>;

Registry-import convenience: build(ImageBuilder.fromRegistry(ref), options).

Parameters:

  • ref string
  • options BuildImageOptions = {}

Returns:

  • Promise<Image>

ArtifactClass

type ArtifactClass = 'linux' | 'windows' | (string & {})

ArtifactRetention

type ArtifactRetention = 'permanent' | 'idle' | (string & {})

ImageStatus

type ImageStatus = 'pending' | 'building' | 'ready' | 'failed' | (string & {})

ImageOrigin

type ImageOrigin = 'registry' | 'dockerfile' | 'capture' | 'windows' | (string & {})

ImageRef

Properties:

  • id string
  • name string | null

BuildImageOptions

Properties:

  • name? string
  • idle? number - Idle-retention window in seconds for an ANONYMOUS image: the image is deleted once this long has passed without a sandbox being created from it (every create restarts the clock). Only without name. Omitted ⇒ the server maximum (DAYTONA_ANON_IMAGE_MAX_IDLE).
  • region? string
  • cpuArch? CpuArch

CaptureImageOptions

Properties:

  • name? string
  • idle? number - Idle-retention window in seconds for an ANONYMOUS capture: deleted once this long has passed without a sandbox being created from it. Only without name. Same rule as images.build: omitted or -1 ⇒ the server maximum (7 days by default); above it ⇒ 400. Promote the image to keep it.

ImageDto

Properties:

  • id string
  • name string | null
  • anonymous boolean
  • availableIn string[]
  • bytes? number | null
  • class ArtifactClass
  • createdAt string
  • error? string | null
  • expiresAt? string | null
  • origin ImageOrigin
  • region string
  • retention ArtifactRetention
  • source? unknown
  • manifest_name? string | null
  • status ImageStatus
  • layer_count? number | null
  • formatVersion? number - The image's format generation: how its artifact is stored (1 = stored by Daytona v1 and not pulled yet; 2 = the current artifact). Undefined from an API older than the field.
  • formatOutdated boolean - formatVersion is below the current one: the image converts on its first Linux sandbox create, or ahead of time with POST /images/{id}/convert; other sandbox classes refuse it with IMAGE_FORMAT_OUTDATED until then.

BuildLogEvent

type BuildLogEvent =
  | { type: 'state'; status: string; error?: string; deadline?: string }
  | { type: 'log'; dataBase64: string; startOffset: string; nextOffset: string; cursor: string }
  | { type: 'gap'; reason: BuildLogGapReason; rawReason: string; requestedOffset: string; firstAvailableOffset: string; droppedBytes: string; cursor: string }
  | { type: 'unavailable'; reason: string }
  | { type: 'source_changed'; reason: string }
  | { type: 'done'; result: BuildLogFollowResult }
  | { type: 'error'; error: string; code: string; retryable: boolean; traceId?: string }

BuildLogFollowOptions

Properties:

  • onLogs (chunk: string) => void | Promise<void>
  • onEvent? (event: BuildLogEvent) => void | Promise<void>
  • cursor? string
  • timeout? number - Total observation budget in milliseconds; zero/omitted adds no deadline.
  • signal? AbortSignal

BuildLogFollowResult

Properties:

  • status string
  • reason BuildLogDoneReason
  • rawReason string
  • cursor? string
  • outputComplete boolean

BuildLogGapReason

const BuildLogGapReason = ["truncated"] as const

BuildLogDoneReason

const BuildLogDoneReason = ["terminal","deadline","not_applicable","resource_deleted"] as const