/** * Docker engine. * * @since 1.0.0 */ import type * as HttpClient from "@effect/platform/HttpClient"; import type * as Socket from "@effect/platform/Socket"; import type * as Schemas from "effect-schemas"; import type * as Effect from "effect/Effect"; import type * as ParseResult from "effect/ParseResult"; import type * as Schema from "effect/Schema"; import type * as Scope from "effect/Scope"; import type * as Stream from "effect/Stream"; import type * as IdSchemas from "./internal/schemas/id.ts"; import type * as MobyConnection from "./MobyConnection.ts"; import type * as MobyDemux from "./MobyDemux.ts"; import type * as MobySchemas from "./MobySchemas.ts"; import * as Layer from "effect/Layer"; import * as MobyEndpoints from "./MobyEndpoints.ts"; import * as internalCircular from "./internal/endpoints/circular.ts"; /** * @since 1.0.0 * @category Errors */ export declare const DockerErrorTypeId: unique symbol; /** * @since 1.0.0 * @category Errors */ export type DockerErrorTypeId = typeof DockerErrorTypeId; /** * @since 1.0.0 * @category Errors */ export declare const isDockerError: (u: unknown) => u is DockerError; /** * @since 1.0.0 * @category Errors */ export type DockerError = internalCircular.DockerError; /** * @since 1.0.0 * @category Errors */ export declare const DockerError: typeof internalCircular.DockerError; /** * @since 1.0.0 * @category Layers */ export type DockerLayer = Layer.Layer; /** * @since 1.0.0 * @category Layers */ export type DockerLayerWithoutHttpClientOrWebsocketConstructor = Layer.Layer, Layer.Layer.Error, Layer.Layer.Context | HttpClient.HttpClient | Socket.WebSocketConstructor>; /** * @since 1.0.0 * @category Layers */ export declare const layerWithoutHttpCLient: DockerLayerWithoutHttpClientOrWebsocketConstructor; /** * @since 1.0.0 * @category Layers */ export declare const layerNodeJS: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerBun: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerDeno: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerUndici: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerWeb: (connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerFetch: (connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged) => DockerLayer; /** * @since 1.0.0 * @category Layers */ export declare const layerAgnostic: (connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged) => DockerLayerWithoutHttpClientOrWebsocketConstructor; export { /** * @since 1.0.0 * @category Auth * @see https://docs.docker.com/reference/api/engine/version/v1.51/#section/Authentication */ RegistryAuth, } from "./internal/endpoints/auth.ts"; /** * Implements the `docker build` command. It doesn't have all the flags that the * images build endpoint exposes. * * @since 1.0.0 * @category Docker */ export declare const build: ({ buildargs, context, dockerfile, platform, tag, }: { tag: string; platform?: string | undefined; dockerfile?: string | undefined; context: Stream.Stream; buildargs?: Record | undefined; }) => Stream.Stream; /** * Implements the `docker build` command as a scoped effect. When the scope is * closed, the built image is removed. It doesn't have all the flags that the * images build endpoint exposes. * * @since 1.0.0 * @category Docker */ export declare const buildScoped: ({ buildargs, context, dockerfile, platform, tag, }: { tag: string; platform?: string | undefined; dockerfile?: string | undefined; buildargs?: Record | undefined; context: Stream.Stream; }) => Effect.Effect, never, Scope.Scope | MobyEndpoints.Images>; /** * Implements the `docker exec` command in a blocking fashion. Incompatible with * web. * * @since 1.0.0 * @category Docker */ export declare const exec: ({ command, containerId, }: { command: string | Array; containerId: IdSchemas.ContainerIdentifier; }) => Effect.Effect<[ exitCode: Schema.Schema.Type, output: string ], Socket.SocketError | ParseResult.ParseError | DockerError, MobyEndpoints.Execs>; /** * Implements the `docker exec` command in a non blocking fashion. Incompatible * with web when not detached. * * @since 1.0.0 * @category Docker */ export declare const execNonBlocking: ({ command, containerId, detach, }: { detach: T; command: string | Array; containerId: IdSchemas.ContainerIdentifier; }) => Effect.Effect<[ [T] extends [false] ? MobyDemux.RawSocket | MobyDemux.MultiplexedSocket : void, IdSchemas.ExecIdentifier ], Socket.SocketError | ParseResult.ParseError | DockerError, MobyEndpoints.Execs>; /** * Implements the `docker exec` command in a blocking fashion with websockets as * the underlying transport instead of the docker engine exec apis so that is * can be compatible with web. * * @since 1.0.0 * @category Docker */ export declare const execWebsockets: ({ command, containerId, }: { command: string | Array; containerId: IdSchemas.ContainerIdentifier; }) => Effect.Effect; /** * Implements the `docker exec` command in a non blocking fashion with * websockets as the underlying transport instead of the docker engine exec apis * so that is can be compatible with web. * * @since 1.0.0 * @category Docker */ export declare const execWebsocketsNonBlocking: ({ command, containerId, cwd, }: { command: string | Array; containerId: IdSchemas.ContainerIdentifier; cwd?: string | undefined; }) => Effect.Effect, never, MobyEndpoints.Containers>; /** * Implements the `docker images` command. * * @since 1.0.0 * @category Docker */ export declare const images: (options?: Parameters[0]) => Effect.Effect, DockerError, MobyEndpoints.Images>; /** * Implements the `docker info` command. * * @since 1.0.0 * @category Docker */ export declare const info: () => Effect.Effect; /** * Implements the `docker ping` command. * * @since 1.0.0 * @category Docker */ export declare const ping: () => Effect.Effect; /** * Implements the `docker ping` command. * * @since 1.0.0 * @category Docker */ export declare const pingHead: () => Effect.Effect; /** * Implements the `docker ps` command. * * @since 1.0.0 * @category Docker */ export declare const ps: (options?: Parameters[0]) => Effect.Effect, DockerError, MobyEndpoints.Containers>; /** * Implements the `docker pull` command. It does not have all the flags that the * images create endpoint exposes. * * @since 1.0.0 * @category Docker */ export declare const pull: ({ image, platform, }: { image: string; platform?: string | undefined; }) => Stream.Stream; /** * Implements the `docker pull` command as a scoped effect. When the scope is * closed, the pulled image is removed. It doesn't have all the flag = * internalDocker.flags that the images create endpoint exposes. * * @since 1.0.0 * @category Docker */ export declare const pullScoped: ({ image, platform, }: { image: string; platform?: string | undefined; }) => Effect.Effect, never, MobyEndpoints.Images | Scope.Scope>; /** * Implements the `docker push` command. * * @since 1.0.0 * @category Docker */ export declare const push: (name: string, options: Parameters[1]) => Stream.Stream; /** * Implements `docker run` command. * * @since 1.0.0 * @category Docker */ export declare const run: (options: Omit[0], "HostConfig"> & { readonly name?: string | undefined; readonly platform?: string | undefined; readonly HostConfig?: ConstructorParameters[0] | undefined; }) => Effect.Effect; /** * Implements `docker run` command as a scoped effect. When the scope is closed, * both the image and the container is removed = internalDocker.removed. * * @since 1.0.0 * @category Docker */ export declare const runScoped: (options: Omit[0], "HostConfig"> & { readonly name?: string | undefined; readonly platform?: string | undefined; readonly HostConfig?: ConstructorParameters[0] | undefined; }) => Effect.Effect; /** * Implements the `docker search` command. * * @since 1.0.0 * @category Docker */ export declare const search: (options: Parameters[0]) => Effect.Effect, DockerError, MobyEndpoints.Images>; /** * Implements the `docker start` command. * * @since 1.0.0 * @category Docker */ export declare const start: (containerId: IdSchemas.ContainerIdentifier) => Effect.Effect; /** * Implements the `docker stop` command. * * @since 1.0.0 * @category Docker */ export declare const stop: (containerId: IdSchemas.ContainerIdentifier) => Effect.Effect; /** * Implements the `docker version` command. * * @since 1.0.0 * @category Docker */ export declare const version: () => Effect.Effect;