Image
Properties:
idstringnamestring | nullanonymousbooleanavailableInstring[]bytes?number | nullclassArtifactClasscreatedAtstringerror?string | nullexpiresAt?string | nulllayer_count?number | nullmanifest_name?string | nulloriginImageOriginregionstringretentionArtifactRetentionsource?unknownstatusImageStatusformatVersion?numberformatOutdatedboolean
Constructors
Constructor
new Image(image: api.ImageListItem): Image;Parameters:
imageapi.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:
namestringvaluestring
Returns:
ImageBuilder
env()
env(values: Record<string, string>): ImageBuilder;Parameters:
valuesRecord<string, string>
Returns:
ImageBuilder
env()
env(nameOrValues: string | Record<string, string>, value?: string): ImageBuilder;Parameters:
nameOrValuesstring | Record<string, string>value?string
Returns:
ImageBuilder
fromDockerfile()
fromDockerfile(dockerfile: string): ImageBuilder;Parameters:
dockerfilestring
Returns:
ImageBuilder
fromRegistry()
fromRegistry(ref: string): ImageBuilder;Parameters:
refstring
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:
namestring
Returns:
ImageBuilder
workdir()
workdir(path: string): ImageBuilder;Parameters:
pathstring
Returns:
ImageBuilder
ImagesService
Constructors
Constructor
new ImagesService(
http: AxiosInstance,
control?: HttpTransport | HttpTransportConfig): ImagesService;Parameters:
httpAxiosInstancecontrol?HttpTransport | HttpTransportConfig
Returns:
ImagesService
Methods
build()
build(builder: ImageBuilder, options: BuildImageOptions = {}): Promise<Image>;Parameters:
builderImageBuilderoptionsBuildImageOptions = {}
Returns:
Promise<Image>
delete()
delete(imageId: string): Promise<void>;Parameters:
imageIdstring
Returns:
Promise<void>
followBuildLogs()
followBuildLogs(
imageId: string,
options: BuildLogFollowOptions): Promise<BuildLogFollowResult>;Parameters:
imageIdstringoptionsBuildLogFollowOptions
Returns:
Promise<BuildLogFollowResult>
get()
get(
imageId: string,
options: { wait?: 'ready'; timeout?: number } = {}): Promise<Image>;Parameters:
imageIdstringoptions{ 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:
imageIdstringnamestring
Returns:
Promise<Image>
pull()
pull(ref: string, options: BuildImageOptions = {}): Promise<Image>;Registry-import convenience: build(ImageBuilder.fromRegistry(ref), options).
Parameters:
refstringoptionsBuildImageOptions = {}
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:
idstringnamestring | null
BuildImageOptions
Properties:
name?stringidle?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 withoutname. Omitted ⇒ the server maximum (DAYTONA_ANON_IMAGE_MAX_IDLE).region?stringcpuArch?CpuArch
CaptureImageOptions
Properties:
name?stringidle?number - Idle-retention window in seconds for an ANONYMOUS capture: deleted once this long has passed without a sandbox being created from it. Only withoutname. Same rule asimages.build: omitted or-1⇒ the server maximum (7 days by default); above it ⇒ 400. Promote the image to keep it.
ImageDto
Properties:
idstringnamestring | nullanonymousbooleanavailableInstring[]bytes?number | nullclassArtifactClasscreatedAtstringerror?string | nullexpiresAt?string | nulloriginImageOriginregionstringretentionArtifactRetentionsource?unknownmanifest_name?string | nullstatusImageStatuslayer_count?number | nullformatVersion?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.formatOutdatedboolean -formatVersionis below the current one: the image converts on its first Linux sandbox create, or ahead of time withPOST /images/{id}/convert; other sandbox classes refuse it withIMAGE_FORMAT_OUTDATEDuntil 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?stringtimeout?number - Total observation budget in milliseconds; zero/omitted adds no deadline.signal?AbortSignal
BuildLogFollowResult
Properties:
statusstringreasonBuildLogDoneReasonrawReasonstringcursor?stringoutputCompleteboolean
BuildLogGapReason
const BuildLogGapReason = ["truncated"] as constBuildLogDoneReason
const BuildLogDoneReason = ["terminal","deadline","not_applicable","resource_deleted"] as const