Docker API
Generated public TypeScript reference for @relkit/docker.
Common APIs
For configuration and examples, read bindings, docker, integrations.
For a complete workflow, follow upload product images, cache product prices.
Public imports
@relkit/docker— 1 exports@relkit/docker/runtime— 16 exports
All exported APIs
Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API’s inline sample, a maintained repository usage, or the shared module walkthrough.
| API | Kind | Import from | Example |
|---|---|---|---|
| createDockerClient | Value | @relkit/docker/runtime |
Source example |
| createDockerMaterializer | Value | @relkit/docker/runtime |
Source example |
| docker | Value | @relkit/docker |
API example |
| DockerClient | Type | @relkit/docker/runtime |
Source example |
| DockerClientOptions | Type | @relkit/docker/runtime |
Module example |
| DockerCommandOptions | Type | @relkit/docker/runtime |
Module example |
| DockerCommandRequest | Type | @relkit/docker/runtime |
Module example |
| DockerCommandResult | Type | @relkit/docker/runtime |
Module example |
| DockerCommandRunner | Type | @relkit/docker/runtime |
Module example |
| DockerContainer | Type | @relkit/docker/runtime |
Module example |
| DockerEngineError | Value | @relkit/docker/runtime |
Module example |
| DockerEngineErrorCode | Type | @relkit/docker/runtime |
Module example |
| DockerEngineInfo | Type | @relkit/docker/runtime |
Module example |
| DockerHealthOptions | Type | @relkit/docker/runtime |
Module example |
| dockerMaterializer | Value | @relkit/docker/runtime |
Module example |
| DockerVolume | Type | @relkit/docker/runtime |
Module example |
| randomLoopbackPort | Value | @relkit/docker/runtime |
Module example |
index.ts
docker
Selects an adapter’s declared local recipe without contacting Docker.
Example
import { docker } from "@relkit/docker";
import { redis } from "@relkit/redis";
const cache = docker(redis());
Signature
declare const docker: <const Adapter extends ProviderAdapter>(
adapter: Adapter,
) => LocalProviderSource<Adapter>;
Since v0.2.0
docker-client.ts
createDockerClient
Signature
declare const createDockerClient: (options?: DockerClientOptions) => DockerClient;
randomLoopbackPort
Signature
declare const randomLoopbackPort: (containerPort: number) => string;
docker-composite-support.ts
argument
Signature
declare const argument: (value: string) => string;
bindMountArguments
Signature
declare const bindMountArguments: (
mounts: readonly LocalServiceBindMount[] | undefined,
) => string[];
compositeLabels
Signature
declare const compositeLabels: (values: Readonly<Record<string, string>>) => string[];
compositeSignal
Signature
declare const compositeSignal: (request: LocalServiceStartRequest) => {
readonly signal?: AbortSignal;
};
environmentArguments
Signature
declare const environmentArguments: (
values: Readonly<Record<string, string>> | undefined,
) => string[];
healthArgs
Signature
declare const healthArgs: (
command: readonly string[],
interval: number,
timeout: number,
retries: number,
) => string[];
inspectNetwork
Signature
declare const inspectNetwork: (
client: DockerClient,
networkName: string,
request: LocalServiceStartRequest,
) => Promise<Readonly<Record<string, string>> | undefined>;
mountPath
Signature
declare const mountPath: (value: string) => string;
owned
Signature
declare const owned: (
actual: Readonly<Record<string, string>>,
expected: Readonly<Record<string, string>>,
) => boolean;
positive
Signature
declare const positive: (value: number) => number;
resourceName
Signature
declare const resourceName: (value: string) => void;
volumeNames
Signature
declare const volumeNames: (
serviceName: string,
requested: Readonly<Record<string, string>> | undefined,
recipe: NormalizedLocalServiceRecipe,
) => Readonly<Record<string, string>>;
docker-composite-unit.ts
reusedUnit
Signature
declare const reusedUnit: (
existing: LocalServiceInstance,
unit: NormalizedLocalServiceUnit,
serviceName: string,
) => LocalServiceInstance;
startUnit
Signature
declare const startUnit: (
client: DockerClient,
request: LocalServiceStartRequest,
recipe: NormalizedLocalServiceRecipe,
unit: NormalizedLocalServiceUnit,
networkName: string,
volumes: Readonly<Record<string, string>>,
gatewayAddress?: string,
) => Promise<LocalServiceInstance>;
docker-composite.ts
startComposite
Signature
declare const startComposite: (
client: DockerClient,
request: LocalServiceStartRequest,
gatewayAddress?: string,
) => Promise<LocalServiceInstance>;
docker-health.ts
healthTimeout
Signature
declare const healthTimeout: (id: string) => never;
publishedPortArguments
Signature
declare const publishedPortArguments: (
containerPort: number,
gatewayAddress?: string,
hostPort?: number,
) => Promise<string[]>;
randomLoopbackPort
Signature
declare const randomLoopbackPort: (containerPort: number) => string;
wait
Signature
declare const wait: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
docker-inspect.ts
parseContainers
Signature
declare const parseContainers: (source: string) => readonly DockerContainer[];
parseVolumes
Signature
declare const parseVolumes: (source: string) => readonly DockerVolume[];
docker-materializer-support.ts
argument
Signature
declare const argument: (value: string) => string;
duration
Signature
declare const duration: (value: number) => string;
healthCommand
Signature
declare const healthCommand: (values: readonly string[]) => string;
labelArguments
Signature
declare const labelArguments: (values: Readonly<Record<string, string>>) => string[];
labelKey
Signature
declare const labelKey: (value: string) => string;
labels
Signature
declare const labels: (values: Readonly<Record<string, string>>) => void;
mountPath
Signature
declare const mountPath: (value: string) => string;
name
Signature
declare const name: (value: string) => string;
networkLabelFilters
Signature
declare const networkLabelFilters: (values: Readonly<Record<string, string>>) => string[];
positive
Signature
declare const positive: (value: number) => number;
resourceName
Signature
declare const resourceName: (value: string) => string;
docker-materializer.ts
createDockerMaterializer
Signature
declare const createDockerMaterializer: (
options?: DockerClientOptions & {
readonly client?: DockerClient;
readonly gatewayAddress?: string;
},
) => LocalServiceMaterializerRuntime;
docker-runner.ts
dockerCommandRunner
Signature
declare const dockerCommandRunner: (executable?: string) => DockerCommandRunner;
docker-types.ts
DockerClient (interface)
Signature
export interface DockerClient {
readonly discover: (signal?: AbortSignal) => Promise<DockerEngineInfo>;
readonly command: (
arguments_: readonly string[],
operation: string,
options?: DockerCommandOptions,
) => Promise<string>;
readonly containers: (
labels?: Readonly<Record<string, string>>,
signal?: AbortSignal,
) => Promise<readonly DockerContainer[]>;
readonly volumes: (
labels?: Readonly<Record<string, string>>,
signal?: AbortSignal,
) => Promise<readonly DockerVolume[]>;
readonly inspectContainer: (id: string, signal?: AbortSignal) => Promise<DockerContainer>;
readonly waitForHealthy: (id: string, options?: DockerHealthOptions) => Promise<DockerContainer>;
}
DockerClientOptions (interface)
Signature
export interface DockerClientOptions {
readonly executable?: string;
readonly run?: DockerCommandRunner;
readonly maxOutputBytes?: number;
readonly commandTimeoutMs?: number;
readonly now?: () => number;
readonly sleep?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
}
DockerCommandOptions (interface)
Signature
export interface DockerCommandOptions {
readonly signal?: AbortSignal;
readonly timeoutMs?: number;
}
DockerCommandRequest (interface)
Signature
export interface DockerCommandRequest extends DockerCommandOptions {
readonly maxOutputBytes: number;
}
DockerCommandResult (interface)
Signature
export interface DockerCommandResult {
readonly exitCode: number;
readonly stdout: string;
readonly stderr: string;
}
DockerCommandRunner (type alias)
Signature
type DockerCommandRunner = (
command: readonly string[],
options: DockerCommandRequest,
) => Promise<DockerCommandResult>;
DockerContainer (interface)
Signature
export interface DockerContainer {
readonly id: string;
readonly name: string;
readonly labels: Readonly<Record<string, string>>;
readonly state: string;
readonly health?: "starting" | "healthy" | "unhealthy";
readonly ports: Readonly<Record<string, number>>;
}
DockerEngineError (class)
Signature
declare class DockerEngineError { constructor(
readonly code: DockerEngineErrorCode,
message: string,
) }
DockerEngineErrorCode (type alias)
Signature
type DockerEngineErrorCode =
| "RELKIT_DOCKER_ARGUMENT_INVALID"
| "RELKIT_DOCKER_UNAVAILABLE"
| "RELKIT_DOCKER_COMMAND_FAILED"
| "RELKIT_DOCKER_COMMAND_TIMEOUT"
| "RELKIT_DOCKER_OUTPUT_LIMIT"
| "RELKIT_DOCKER_RESPONSE_INVALID"
| "RELKIT_DOCKER_HEALTH_FAILED"
| "RELKIT_DOCKER_HEALTH_TIMEOUT"
| "RELKIT_DOCKER_CANCELLED";
DockerEngineInfo (interface)
Signature
export interface DockerEngineInfo {
readonly version: string;
}
DockerHealthOptions (interface)
Signature
export interface DockerHealthOptions {
readonly timeoutMs?: number;
readonly pollIntervalMs?: number;
readonly signal?: AbortSignal;
}
DockerVolume (interface)
Signature
export interface DockerVolume {
readonly name: string;
readonly labels: Readonly<Record<string, string>>;
}
docker-validation.ts
cancelled
Signature
declare const cancelled: () => never;
invalidArgument
Signature
declare const invalidArgument: () => never;
invalidResponse
Signature
declare const invalidResponse: () => never;
labelFilters
Signature
declare const labelFilters: (labels: Readonly<Record<string, string>> | undefined) => string[];
optionalSignal
Signature
declare const optionalSignal: (signal: AbortSignal | undefined) => DockerCommandOptions;
positive
Signature
declare const positive: (value: number, name: string) => number;
requiredText
Signature
declare const requiredText: (value: unknown, name: string) => string;
resourceLines
Signature
declare const resourceLines: (value: string) => string[];
responseText
Signature
declare const responseText: (value: unknown) => string;
validateArgument
Signature
declare const validateArgument: (value: string) => void;
validateArguments
Signature
declare const validateArguments: (values: readonly string[]) => void;
validateResourceId
Signature
declare const validateResourceId: (value: string) => void;
index.ts
“./docker-client.js” (namespace export)
Re-exports all named exports from the “./docker-client.js” module.
Signature
export * from "./docker-client.js";
“./docker-materializer.js” (namespace export)
Re-exports all named exports from the “./docker-materializer.js” module.
Signature
export * from "./docker-materializer.js";
“./docker-types.js” (namespace export)
Re-exports all named exports from the “./docker-types.js” module.
Signature
export * from "./docker-types.js";
dockerMaterializer
Signature
declare const dockerMaterializer: Readonly<{
kind: "local-service-materializer";
protocolVersion: 1;
integrationId: "docker";
}>;