DockerEngine.ts overview
Docker engine.
Since v1.0.0
Exports Grouped by Category
Auth
RegistryAuth
See
- https://docs.docker.com/reference/api/engine/version/v1.51/#section/Authentication
Signature
declare const RegistryAuth: typeof RegistryAuth
Since v1.0.0
Docker
build
Implements the docker build command. It doesn’t have all the flags that the images build endpoint exposes.
Signature
declare const build: <E1>({
buildargs,
context,
dockerfile,
platform,
tag
}: {
tag: string
platform?: string | undefined
dockerfile?: string | undefined
context: Stream.Stream<Uint8Array, E1, never>
buildargs?: Record<string, string | undefined> | undefined
}) => Stream.Stream<MobySchemas.JSONMessage, DockerError, MobyEndpoints.Images>
Since v1.0.0
buildScoped
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.
Signature
declare const buildScoped: <E1>({
buildargs,
context,
dockerfile,
platform,
tag
}: {
tag: string
platform?: string | undefined
dockerfile?: string | undefined
buildargs?: Record<string, string | undefined> | undefined
context: Stream.Stream<Uint8Array, E1, never>
}) => Effect.Effect<
Stream.Stream<MobySchemas.JSONMessage, DockerError, never>,
never,
Scope.Scope | MobyEndpoints.Images
>
Since v1.0.0
exec
Implements the docker exec command in a blocking fashion. Incompatible with web.
Signature
declare const exec: ({
command,
containerId
}: {
command: string | Array<string>
containerId: IdSchemas.ContainerIdentifier
}) => Effect.Effect<
[exitCode: Schema.Schema.Type<Schemas.Number.I64>, output: string],
Socket.SocketError | ParseResult.ParseError | DockerError,
MobyEndpoints.Execs
>
Since v1.0.0
execNonBlocking
Implements the docker exec command in a non blocking fashion. Incompatible with web when not detached.
Signature
declare const execNonBlocking: <const T extends boolean = false>({
command,
containerId,
detach
}: {
detach: T
command: string | Array<string>
containerId: IdSchemas.ContainerIdentifier
}) => Effect.Effect<
[[T] extends [false] ? MobyDemux.RawSocket | MobyDemux.MultiplexedSocket : void, IdSchemas.ExecIdentifier],
Socket.SocketError | ParseResult.ParseError | DockerError,
MobyEndpoints.Execs
>
Since v1.0.0
execWebsockets
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.
Signature
declare const execWebsockets: ({
command,
containerId
}: {
command: string | Array<string>
containerId: IdSchemas.ContainerIdentifier
}) => Effect.Effect<
readonly [stdout: string, stderr: string],
Socket.SocketError | ParseResult.ParseError | DockerError,
MobyEndpoints.Containers
>
Since v1.0.0
execWebsocketsNonBlocking
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.
Signature
declare const execWebsocketsNonBlocking: ({
command,
containerId,
cwd
}: {
command: string | Array<string>
containerId: IdSchemas.ContainerIdentifier
cwd?: string | undefined
}) => Effect.Effect<
MobyDemux.MultiplexedChannel<never, Socket.SocketError | DockerError, never>,
never,
MobyEndpoints.Containers
>
Since v1.0.0
images
Implements the docker images command.
Signature
declare const images: (
options?: Parameters<MobyEndpoints.Images["list"]>[0]
) => Effect.Effect<ReadonlyArray<MobySchemas.ImageSummary>, DockerError, MobyEndpoints.Images>
Since v1.0.0
info
Implements the docker info command.
Signature
declare const info: () => Effect.Effect<MobySchemas.SystemInfo, DockerError, MobyEndpoints.System>
Since v1.0.0
ping
Implements the docker ping command.
Signature
declare const ping: () => Effect.Effect<void, DockerError, MobyEndpoints.System>
Since v1.0.0
pingHead
Implements the docker ping command.
Signature
declare const pingHead: () => Effect.Effect<void, DockerError, MobyEndpoints.System>
Since v1.0.0
ps
Implements the docker ps command.
Signature
declare const ps: (
options?: Parameters<MobyEndpoints.Containers["list"]>[0]
) => Effect.Effect<ReadonlyArray<MobySchemas.ContainerSummary>, DockerError, MobyEndpoints.Containers>
Since v1.0.0
pull
Implements the docker pull command. It does not have all the flags that the images create endpoint exposes.
Signature
declare const pull: ({
image,
platform
}: {
image: string
platform?: string | undefined
}) => Stream.Stream<MobySchemas.JSONMessage, DockerError, MobyEndpoints.Images>
Since v1.0.0
pullScoped
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.
Signature
declare const pullScoped: ({
image,
platform
}: {
image: string
platform?: string | undefined
}) => Effect.Effect<
Stream.Stream<MobySchemas.JSONMessage, DockerError, never>,
never,
MobyEndpoints.Images | Scope.Scope
>
Since v1.0.0
push
Implements the docker push command.
Signature
declare const push: (
name: string,
options: Parameters<MobyEndpoints.Images["push"]>[1]
) => Stream.Stream<MobySchemas.JSONMessage, DockerError, MobyEndpoints.Images>
Since v1.0.0
run
Implements docker run command.
Signature
declare const run: (
options: Omit<ConstructorParameters<typeof MobySchemas.ContainerCreateRequest>[0], "HostConfig"> & {
readonly name?: string | undefined
readonly platform?: string | undefined
readonly HostConfig?: ConstructorParameters<typeof MobySchemas.ContainerHostConfig>[0] | undefined
}
) => Effect.Effect<MobySchemas.ContainerInspectResponse, DockerError, MobyEndpoints.Containers>
Since v1.0.0
runScoped
Implements docker run command as a scoped effect. When the scope is closed, both the image and the container is removed = internalDocker.removed.
Signature
declare const runScoped: (
options: Omit<ConstructorParameters<typeof MobySchemas.ContainerCreateRequest>[0], "HostConfig"> & {
readonly name?: string | undefined
readonly platform?: string | undefined
readonly HostConfig?: ConstructorParameters<typeof MobySchemas.ContainerHostConfig>[0] | undefined
}
) => Effect.Effect<MobySchemas.ContainerInspectResponse, DockerError, Scope.Scope | MobyEndpoints.Containers>
Since v1.0.0
search
Implements the docker search command.
Signature
declare const search: (
options: Parameters<MobyEndpoints.Images["search"]>[0]
) => Effect.Effect<ReadonlyArray<MobySchemas.RegistrySearchResult>, DockerError, MobyEndpoints.Images>
Since v1.0.0
start
Implements the docker start command.
Signature
declare const start: (
containerId: IdSchemas.ContainerIdentifier
) => Effect.Effect<void, DockerError, MobyEndpoints.Containers>
Since v1.0.0
stop
Implements the docker stop command.
Signature
declare const stop: (
containerId: IdSchemas.ContainerIdentifier
) => Effect.Effect<void, DockerError, MobyEndpoints.Containers>
Since v1.0.0
version
Implements the docker version command.
Signature
declare const version: () => Effect.Effect<MobySchemas.TypesVersion, DockerError, MobyEndpoints.System>
Since v1.0.0
Errors
DockerError
Signature
declare const DockerError: typeof internalCircular.DockerError
Since v1.0.0
DockerError (type alias)
Signature
type DockerError = internalCircular.DockerError
Since v1.0.0
DockerErrorTypeId
Signature
declare const DockerErrorTypeId: unique symbol
Since v1.0.0
DockerErrorTypeId (type alias)
Signature
type DockerErrorTypeId = typeof DockerErrorTypeId
Since v1.0.0
isDockerError
Signature
declare const isDockerError: (u: unknown) => u is DockerError
Since v1.0.0
Layers
DockerLayer (type alias)
Signature
type DockerLayer = Layer.Layer<
| MobyEndpoints.Configs
| MobyEndpoints.Containers
| MobyEndpoints.Distributions
| MobyEndpoints.Execs
| MobyEndpoints.Images
| MobyEndpoints.Networks
| MobyEndpoints.Nodes
| MobyEndpoints.Plugins
| MobyEndpoints.Secrets
| MobyEndpoints.Services
| MobyEndpoints.Sessions
| MobyEndpoints.Swarm
| MobyEndpoints.System
| MobyEndpoints.Tasks
| MobyEndpoints.Volumes,
never,
never
>
Since v1.0.0
DockerLayerWithoutHttpClientOrWebsocketConstructor (type alias)
Signature
type DockerLayerWithoutHttpClientOrWebsocketConstructor = Layer.Layer<
Layer.Layer.Success<DockerLayer>,
Layer.Layer.Error<DockerLayer>,
Layer.Layer.Context<DockerLayer> | HttpClient.HttpClient | Socket.WebSocketConstructor
>
Since v1.0.0
layerAgnostic
Signature
declare const layerAgnostic: (
connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
) => DockerLayerWithoutHttpClientOrWebsocketConstructor
Since v1.0.0
layerBun
Signature
declare const layerBun: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer
Since v1.0.0
layerDeno
Signature
declare const layerDeno: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer
Since v1.0.0
layerFetch
Signature
declare const layerFetch: (
connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
) => DockerLayer
Since v1.0.0
layerNodeJS
Signature
declare const layerNodeJS: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer
Since v1.0.0
layerUndici
Signature
declare const layerUndici: (connectionOptions: MobyConnection.MobyConnectionOptions) => DockerLayer
Since v1.0.0
layerWeb
Signature
declare const layerWeb: (
connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
) => DockerLayer
Since v1.0.0
layerWithoutHttpCLient
Signature
declare const layerWithoutHttpCLient: DockerLayerWithoutHttpClientOrWebsocketConstructor
Since v1.0.0