import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import * as Path from "effect/Path"; import { PlatformError } from "effect/PlatformError"; import * as Redacted from "effect/Redacted"; import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawner"; import type { ScopedPlanStatusSession } from "../Cli/Cli.ts"; declare const Docker_base: Context.ServiceClass) => Effect.Effect; /** Writes build files and an inline Dockerfile to the given context directory. */ readonly materialize: (options: { context: string; dockerfile: string; files: ReadonlyArray<{ path: string; content: string | Uint8Array; }>; }) => Effect.Effect; readonly container: { /** Creates a new container. */ readonly create: (options: { name: string; image: string; volume: Array | undefined; env: Record | undefined; restart: "no" | "always" | "on-failure" | "unless-stopped"; rm: boolean; "health-cmd": string | undefined; "health-interval": string | undefined; "health-timeout": string | undefined; "health-retries": number | undefined; "health-start-period": string | undefined; "health-start-interval": string | undefined; "stop-timeout": string | undefined; p: Array | undefined; command: Array | undefined; label?: Record; context?: string; }) => Effect.Effect; /** Inspects a container. */ readonly inspect: (name: string, context?: string) => Effect.Effect; /** Removes a container. */ readonly remove: (name: string, force?: boolean, context?: string) => Effect.Effect; /** Starts a container. */ readonly start: (name: string, context?: string) => Effect.Effect; /** Stops a container. */ readonly stop: (name: string, context?: string) => Effect.Effect; }; readonly image: { /** Builds a new image. If a session is provided, build logs will be emitted as session notes. */ readonly build: (options: { context: string; tag: string; file?: string; platform?: string; target?: string; "build-arg"?: Record; "cache-from"?: Array; "cache-to"?: Array; args?: Array; engineContext?: string; }, session?: ScopedPlanStatusSession) => Effect.Effect; /** Pulls an image. */ readonly pull: (ref: string, platform?: string, context?: string) => Effect.Effect; /** * Pushes an image to a registry. When `platform` is given, only that * platform's manifest is pushed (`docker push --platform`) — with the * containerd image store, a bare push sends every locally-present * variant of a multi-arch tag, so a stale other-arch variant in the * local cache would otherwise reach the registry. Engines whose store * doesn't support the flag fall back to a plain push (their local tag * is already narrowed by `pull --platform`). */ readonly push: (ref: string, credentials: { server: string; username: string; password: string | Redacted.Redacted; }, platform?: string, context?: string) => Effect.Effect; /** Tags an image. */ readonly tag: (source: string, target: string, context?: string) => Effect.Effect; /** Inspects an image. */ readonly inspect: (ref: string, context?: string) => Effect.Effect; /** Removes an image. */ readonly remove: (ref: string | Array, force?: boolean, context?: string) => Effect.Effect; }; readonly volume: { /** Creates a new volume. */ readonly create: (options: { name: string; driver?: string; opt?: Record; label?: Record; context?: string; }) => Effect.Effect; /** Removes a volume. */ readonly remove: (name: string, context?: string) => Effect.Effect; /** Inspects a volume. */ readonly inspect: (name: string, context?: string) => Effect.Effect; }; readonly context: { /** Creates a new Docker context. */ readonly create: (options: { name: string; description?: string; /** Raw value for `--docker`, for example `host=ssh://user@host`. */ docker?: string; }) => Effect.Effect; /** Updates an existing Docker context. */ readonly update: (options: { name: string; description?: string; /** Raw value for `--docker`, for example `host=ssh://user@host`. */ docker?: string; }) => Effect.Effect; /** Inspects a Docker context. */ readonly inspect: (name: string) => Effect.Effect; /** Removes a Docker context. */ readonly remove: (name: string, force?: boolean) => Effect.Effect; }; readonly network: { /** Creates a new network. */ readonly create: (options: { name: string; driver: string; ipv6?: boolean; label?: Record; context?: string; }) => Effect.Effect; /** Connects a container to a network. */ readonly connect: (options: { network: string; container: string; alias?: string[]; context?: string; }) => Effect.Effect; /** Disconnects a container from a network. */ readonly disconnect: (options: { network: string; container: string; context?: string; }) => Effect.Effect; /** Inspects a network. */ readonly inspect: (name: string, context?: string) => Effect.Effect; /** Removes a network. */ readonly remove: (id: string, context?: string) => Effect.Effect; }; readonly swarm: { /** Initializes swarm mode on the engine (`docker swarm init`). */ readonly init: (options: { context?: string; "advertise-addr"?: string; "listen-addr"?: string; "default-addr-pool"?: string[]; "default-addr-pool-mask-length"?: number; }) => Effect.Effect; /** Reads the engine's swarm state (`docker info --format '{{json .Swarm}}'`). */ readonly info: (context?: string) => Effect.Effect; /** Leaves the swarm (`docker swarm leave`). */ readonly leave: (force?: boolean, context?: string) => Effect.Effect; }; readonly service: { /** Creates a new service. */ readonly create: (options: { name: string; image: string; context?: string; replicas?: number; "endpoint-mode"?: "vip" | "dnsrr"; network?: string[]; constraint?: string[]; "replicas-max-per-node"?: number; "placement-pref"?: string[]; "update-parallelism"?: number; "update-delay"?: string; "update-monitor"?: string; "update-failure-action"?: "pause" | "continue" | "rollback"; "update-max-failure-ratio"?: number; "update-order"?: "stop-first" | "start-first"; "rollback-parallelism"?: number; "rollback-delay"?: string; "rollback-monitor"?: string; "rollback-failure-action"?: "pause" | "continue" | "rollback"; "rollback-max-failure-ratio"?: number; "rollback-order"?: "stop-first" | "start-first"; "restart-condition"?: "none" | "on-failure" | "any"; "restart-delay"?: string; "restart-max-attempts"?: number; "restart-window"?: string; "health-cmd"?: string; "health-interval"?: string; "health-timeout"?: string; "health-retries"?: number; "health-start-period"?: string; "stop-grace-period"?: string; mount?: string[]; secret?: string[]; config?: string[]; "read-only"?: boolean; publish?: string[]; label?: Record; env?: Record; command?: string[]; args?: string[]; }) => Effect.Effect; /** Updates an existing service. */ readonly update: (options: { id: string; image: string; context?: string; replicas?: number; "endpoint-mode"?: "vip" | "dnsrr"; "constraint-add"?: string[]; "constraint-rm"?: string[]; "replicas-max-per-node"?: number; "placement-pref"?: string[]; "update-parallelism"?: number; "update-delay"?: string; "update-monitor"?: string; "update-failure-action"?: "pause" | "continue" | "rollback"; "update-max-failure-ratio"?: number; "update-order"?: "stop-first" | "start-first"; "rollback-parallelism"?: number; "rollback-delay"?: string; "rollback-monitor"?: string; "rollback-failure-action"?: "pause" | "continue" | "rollback"; "rollback-max-failure-ratio"?: number; "rollback-order"?: "stop-first" | "start-first"; "restart-condition"?: "none" | "on-failure" | "any"; "restart-delay"?: string; "restart-max-attempts"?: number; "restart-window"?: string; "health-cmd"?: string; "health-interval"?: string; "health-timeout"?: string; "health-retries"?: number; "health-start-period"?: string; "stop-grace-period"?: string; "mount-add"?: string[]; "secret-add"?: string[]; "config-add"?: string[]; "read-only"?: boolean; "publish-add"?: string[]; "label-add"?: Record; "label-rm"?: string[]; "env-add"?: Record; args?: string; }) => Effect.Effect; /** Inspects a service. */ readonly inspect: (id: string, context?: string) => Effect.Effect; /** Removes a service. */ readonly remove: (id: string, context?: string) => Effect.Effect; }; }>; export declare class Docker extends Docker_base { } export declare namespace Docker { type ContextRef = string | { name: string; }; /** * A reference to the Docker engine an operation runs against: a context * name, a `Docker.Context` resource, or a `Docker.Swarm` resource * (narrowed structurally by its `nodeId` attribute) — passing the swarm * also orders the operation after the swarm is initialized. */ type EngineRef = ContextRef | { nodeId: string; context?: string; }; interface SwarmInfo { NodeID: string; LocalNodeState: "inactive" | "pending" | "active" | "error" | "locked" | (string & {}); ControlAvailable: boolean; Cluster?: { ID: string; CreatedAt?: string; } | null; RemoteManagers?: Array<{ NodeID: string; Addr: string; }> | null; Managers?: number; Nodes?: number; } type ContainerStatus = "created" | "running" | "paused" | "restarting" | "removing" | "exited" | "dead"; interface Container { Id: string; Name?: string; State: { Status: ContainerStatus; }; Created: string; Config: { Image: string; Cmd: string[] | null; Env: string[] | null; Labels: Record | null; StopTimeout?: number; Healthcheck?: { Test: string[] | null; Interval?: number; Timeout?: number; Retries?: number; StartPeriod?: number; StartInterval?: number; } | null; }; HostConfig: { PortBindings: Record | null> | null; Binds: string[] | null; RestartPolicy: { Name: string; MaximumRetryCount: number; }; AutoRemove: boolean; }; NetworkSettings: { Networks: Record | null; Ports?: Record | null> | null; }; } interface Image { Id: string; Created?: string; RepoTags?: string[] | null; RepoDigests?: string[] | null; } interface Volume { CreatedAt: string; Driver: string; Labels: Record | null; Mountpoint: string; Name: string; Options: Record | null; Scope: string; } interface Context { Name: string; Metadata?: { Description?: string; }; Endpoints?: { docker?: string; }; } interface Network { Name: string; Id: string; Created: string; Scope: string; Driver: string; EnableIPv6: boolean; Labels: Record | null; } } export interface CommandOutput { exitCode: ChildProcessSpawner.ExitCode; stdout: string; stderr: string; } export declare const DockerLive: Layer.Layer; export declare const dockerContextName: (context: Docker.ContextRef | undefined) => string | undefined; /** * Resolve an {@link Docker.EngineRef} to a context name. A `Docker.Swarm` * reference (narrowed by its `nodeId` attribute) contributes the context the * swarm was initialized on. */ export declare const dockerEngineContextName: (ref: Docker.EngineRef | undefined) => string | undefined; export declare const dockerPhysicalName: (id: string, props: { name?: string; } | undefined, instanceId: string, maxLength?: number) => Effect.Effect; export {}; //# sourceMappingURL=Docker.d.ts.map