Skip to main content Link Search Menu Expand Document (external link)

Promises.ts overview

Docker engine promises api

Since v1.0.0


Exports Grouped by Category


Promises

promiseClient

Create a promise client for the docker engine

Signature

declare const promiseClient: <E>(
  layer: Layer.Layer<
    Layer.Layer.Success<DockerEngine.DockerLayer>,
    Layer.Layer.Error<DockerEngine.DockerLayer> | E,
    Layer.Layer.Context<DockerEngine.DockerLayer>
  >
) => Promise<{
  pull: (a: {
    image: string
    auth?: string | undefined
    platform?: string | undefined
  }) => ReadableStream<MobySchemas.JSONMessage>
  build: <E1>(a: {
    tag: string
    auth?: string | undefined
    platform?: string | undefined
    dockerfile?: string | undefined
    context: Stream.Stream<Uint8Array, E1, never>
    buildArgs?: Record<string, string | undefined> | undefined
  }) => ReadableStream<MobySchemas.JSONMessage>
  stop: (containerId: string) => Promise<void>
  start: (containerId: string) => Promise<void>
  run: (containerOptions: string) => Promise<MobySchemas.ContainerInspectResponse>
  exec: (a_0: {
    containerId: string
    command: string | Array<string>
  }) => Promise<readonly [exitCode: number, output: string]>
  execNonBlocking: <T extends boolean | undefined = undefined>(a_0: {
    detach?: T
    containerId: string
    command: string | Array<string>
  }) => Promise<[socket: T extends true ? void : RawSocket | MultiplexedSocket, execId: string]>
  execWebsockets: (a_0: {
    command: string | Array<string>
    containerId: string
  }) => Promise<readonly [stdout: string, stderr: string]>
  execWebsocketsNonBlocking: (a: {
    command: string | Array<string>
    containerId: string
    cwd?: string | undefined
  }) => ReadableStream<MultiplexedChannel<never, any, never>>
  ps: (
    options?:
      | {
          readonly name?: ReadonlyArray<string> | undefined
          readonly ancestor?: ReadonlyArray<string> | undefined
          readonly before?: ReadonlyArray<string> | undefined
          readonly expose?: ReadonlyArray<string> | undefined
          readonly exited?: ReadonlyArray<number> | undefined
          readonly health?: ReadonlyArray<MobySchemas.HealthStatus> | undefined
          readonly id?: ReadonlyArray<string & Brand<"ContainerId">> | undefined
          readonly isolation?: ReadonlyArray<"" | "default" | "process" | "hyperv"> | undefined
          readonly volume?: boolean | undefined
          readonly "is-task"?: boolean | undefined
          readonly label?: ReadonlyArray<string> | undefined
          readonly network?: ReadonlyArray<string> | undefined
          readonly publish?: ReadonlyArray<string> | undefined
          readonly since?: ReadonlyArray<string> | undefined
          readonly status?:
            | ReadonlyArray<"exited" | "created" | "running" | "paused" | "restarting" | "removing" | "dead">
            | undefined
        }
      | undefined
  ) => Promise<ReadonlyArray<MobySchemas.ContainerListResponseItem>>
  push: (options: {
    readonly name: string
    readonly tag?: string
    readonly "X-Registry-Auth": string
  }) => ReadableStream<string>
  images: (
    options?:
      | {
          readonly all?: boolean
          readonly filters?: string | undefined
          readonly "shared-size"?: boolean | undefined
          readonly digests?: boolean | undefined
        }
      | undefined
  ) => Promise<ReadonlyArray<MobySchemas.ImageSummary>>
  search: (options: {
    readonly term: string
    readonly limit?: number | undefined
    readonly stars?: number | undefined
    readonly "is-official"?: boolean | undefined
  }) => Promise<ReadonlyArray<MobySchemas.RegistrySearchResponse>>
  version: () => Promise<Readonly<MobySchemas.SystemVersionResponse>>
  info: () => Promise<Readonly<MobySchemas.SystemInfoResponse>>
  ping: () => Promise<"OK">
  pingHead: () => Promise<void>
  followProgressInConsole: (
    evaluate: Function.LazyArg<ReadableStream<MobySchemas.JSONMessage>>,
    onError: (error: unknown) => unknown
  ) => Promise<ReadonlyArray<MobySchemas.JSONMessage>>
  waitForProgressToComplete: (
    evaluate: Function.LazyArg<ReadableStream<MobySchemas.JSONMessage>>,
    onError: (error: unknown) => unknown
  ) => Promise<ReadonlyArray<MobySchemas.JSONMessage>>
}>

Source

Since v1.0.0