Skip to content
View as Markdown

Properties:

  • id string
  • name string | null
  • anonymous boolean
  • availableIn string[]
  • bytes? number | null
  • class ArtifactClass
  • createdAt string
  • updatedAt string
  • error? string | null
  • expiresAt? string | null
  • layer_count? number | null
  • origin ImageOrigin
  • region string
  • retention ArtifactRetention
  • rawRetention string
  • source? ImageSource | null
  • status ImageStatus
  • formatVersion? number
  • formatOutdated boolean
  • platform boolean
  • default boolean
  • deprecated boolean
  • diskMib number | null
new Image(image: api.ImageListItem): Image;

Parameters:

  • image api.ImageListItem

Returns:

  • Image

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

Parameters:

  • ...args: readonly string[]

Returns:

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

Parameters:

  • ...args: readonly string[]

Returns:

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

Parameters:

  • name string
  • value string

Returns:

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

Parameters:

  • values Record<string, string>

Returns:

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

Parameters:

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

Returns:

  • ImageBuilder
fromDockerfile(dockerfile: string): ImageBuilder;

Parameters:

  • dockerfile string

Returns:

  • ImageBuilder
fromRegistry(ref: string): ImageBuilder;

Parameters:

  • ref string

Returns:

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

Parameters:

  • ...packages: readonly string[]

Returns:

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

Parameters:

  • ...commands: readonly string[]

Returns:

  • ImageBuilder
toDockerfile(): string;

Returns:

  • string
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(name: string): ImageBuilder;

Parameters:

  • name string

Returns:

  • ImageBuilder
workdir(path: string): ImageBuilder;

Parameters:

  • path string

Returns:

  • ImageBuilder

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

Parameters:

  • http AxiosInstance
  • control? HttpTransport | HttpTransportConfig

Returns:

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

Parameters:

  • builder ImageBuilder
  • options BuildImageOptions = {}

Returns:

  • Promise<img />
delete(imageId: string): Promise<void>;

Parameters:

  • imageId string

Returns:

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

Parameters:

  • imageId string
  • options BuildLogFollowOptions

Returns:

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

Parameters:

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

Returns:

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

Parameters:

  • options { cursor?: string; limit?: number; name?: string; anonymous?: boolean; sandboxId?: string; platform?: ‘true’ | ‘false’ | ‘any’ } = {}

Returns:

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

Parameters:

  • options { cursor?: string; limit?: number; name?: string; anonymous?: boolean; sandboxId?: string; platform?: ‘true’ | ‘false’ | ‘any’ } = {}

Returns:

  • Promise<ListResult<img />>
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<img />
pull(ref: string, options: BuildImageOptions = {}): Promise<Image>;

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

Parameters:

  • ref string
  • options BuildImageOptions = {}

Returns:

  • Promise<img />

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

type ArtifactRetention = (typeof API_IMAGE_RETENTIONS)[number] | 'unknown'

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

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

type ImageSource =
| { readonly type: 'registry'; readonly ref: string }
| { readonly type: 'dockerfile'; readonly contextObject: string; readonly dockerfile: string }
| { readonly type: 'named'; readonly name: string }
| { readonly type: 'manifest'; readonly name: string }

Properties:

  • id string
  • name string | null

Properties:

  • name? string
  • idleExpirySeconds? 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

Properties:

  • name? string
  • idleExpirySeconds? 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.

Properties:

  • id string
  • name string | null
  • anonymous boolean
  • availableIn string[]
  • bytes? number | null
  • class ArtifactClass
  • createdAt string
  • updatedAt string
  • error? string | null
  • expiresAt? string | null
  • origin ImageOrigin
  • region string
  • retention ArtifactRetention
  • rawRetention string
  • source? ImageSource | 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.
  • platform boolean - A platform image: published by the operator and visible to every project. False from an API older than the field.
  • default boolean - The platform default for its class: the image an imageless create() boots.
  • deprecated boolean - A deprecated platform image: it still boots and resolves by id, but images.list({ platform: 'true' }) no longer lists it.
  • diskMib number | null - The disk size in MiB that a sandbox created from this image gets when the create omits disk_mib. Set for macOS snapshots; null for every other image and from an API older than the field.

type BuildLogGapReason = 'truncated' | 'unknown'

type BuildLogDoneReason = 'terminal' | 'deadline' | 'not_applicable' | 'resource_deleted' | 'unknown'

type BuildLogEvent =
| { type: 'state'; status: string; error?: string; deadlineAt?: 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 }

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

Properties:

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