/** * docker() resource — manage Docker containers on target hosts. * * `check()` inspects the local image cache and container configuration. * `apply()` pulls images, creates/recreates containers, and starts/stops them. */ import type { ExecutionContext, ResourceCallMeta, ResourceDefinition, ResourceSchema } from "../core/types.ts"; /** Published host port mapping for a managed container. */ export type DockerPortInput = { hostPort: number; containerPort: number; protocol?: "tcp" | "udp" | undefined; hostIp?: string | undefined; }; /** Bind mount configuration for a managed container. */ export type DockerMountInput = { source: string; target: string; readOnly?: boolean | undefined; }; /** Input options for the docker resource. */ export type DockerInput = { /** Container name. */ name: string; /** Image reference to create or refresh from. */ image?: string | undefined; /** Desired lifecycle state. Default: "started". */ state?: "started" | "present" | "stopped" | "absent" | undefined; /** Image pull strategy. Default: "if-missing". */ pull?: "if-missing" | "always" | "never" | undefined; /** Environment variables. */ env?: Record | undefined; /** Published ports. */ ports?: DockerPortInput[] | undefined; /** Bind mounts. */ mounts?: DockerMountInput[] | undefined; /** Restart policy. */ restart?: "no" | "on-failure" | "unless-stopped" | "always" | undefined; /** Command argv override. */ command?: string[] | undefined; /** Entrypoint argv override. */ entrypoint?: string[] | undefined; /** Labels to set on the container. */ labels?: Record | undefined; /** User override. */ user?: string | undefined; /** Working directory override. */ workdir?: string | undefined; }; /** Output of a successful docker resource. */ export type DockerOutput = { name: string; image: string; imageId: string; containerId: string; state: "running" | "stopped" | "absent"; changed: boolean; }; /** Schema for the docker resource. */ export declare const dockerSchema: ResourceSchema; /** ResourceDefinition for docker. */ export declare const dockerDefinition: ResourceDefinition; /** * Create a bound `docker()` function for a given execution context. * * Usage in recipes: * ```ts * const docker = createDocker(ctx) * await docker({ name: 'nginx', image: 'nginx:1.27', ports: [{ hostPort: 8080, containerPort: 80 }] }) * ``` */ export declare function createDocker(ctx: ExecutionContext): (input: DockerInput, meta?: ResourceCallMeta) => Promise>; //# sourceMappingURL=docker.d.ts.map