DockerEngine.ts overview
Docker engine.
Since v1.0.0
Exports Grouped by Category
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>({
auth,
buildArgs,
context,
dockerfile,
platform,
tag
}: {
tag: string
auth?: string | undefined
platform?: string | undefined
dockerfile?: string | undefined
context: Stream.Stream<Uint8Array, E1, never>
buildArgs?: Record<string, string | undefined> | undefined
}) => Stream.Stream<MobySchemas.JSONMessage, MobyEndpoints.ImagesError, 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>({
auth,
buildArgs,
context,
dockerfile,
platform,
tag
}: {
tag: string
auth?: string | undefined
platform?: string | undefined
dockerfile?: string | undefined
buildArgs?: Record<string, string | undefined> | undefined
context: Stream.Stream<Uint8Array, E1, never>
}) => Effect.Effect<
Stream.Stream<MobySchemas.JSONMessage, MobyEndpoints.ImagesError, 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
}: {
containerId: string
command: string | Array<string>
}) => Effect.Effect<
readonly [exitCode: number, output: string],
MobyEndpoints.ExecsError | Socket.SocketError | ParseResult.ParseError,
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: <T extends boolean | undefined = undefined>({
command,
containerId,
detach
}: {
detach?: T
containerId: string
command: string | Array<string>
}) => Effect.Effect<
[socket: T extends true ? void : MobyDemux.RawSocket | MobyDemux.MultiplexedSocket, execId: string],
MobyEndpoints.ExecsError,
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: string
}) => Effect.Effect<
readonly [stdout: string, stderr: string],
MobyEndpoints.ContainersError | Socket.SocketError | ParseResult.ParseError,
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: string
cwd?: string | undefined
}) => Effect.Effect<
MobyDemux.MultiplexedChannel<never, Socket.SocketError | MobyEndpoints.ContainersError, 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>, MobyEndpoints.ImagesError, MobyEndpoints.Images>
Since v1.0.0
info
Implements the docker info
command.
Signature
declare const info: () => Effect.Effect<
Readonly<MobySchemas.SystemInfoResponse>,
MobyEndpoints.SystemsError,
MobyEndpoints.Systems
>
Since v1.0.0
ping
Implements the docker ping
command.
Signature
declare const ping: () => Effect.Effect<"OK", MobyEndpoints.SystemsError, MobyEndpoints.Systems>
Since v1.0.0
pingHead
Implements the docker ping
command.
Signature
declare const pingHead: () => Effect.Effect<void, MobyEndpoints.SystemsError, MobyEndpoints.Systems>
Since v1.0.0
ps
Implements the docker ps
command.
Signature
declare const ps: (
options?: Parameters<MobyEndpoints.Containers["list"]>[0]
) => Effect.Effect<
ReadonlyArray<MobySchemas.ContainerListResponseItem>,
MobyEndpoints.ContainersError,
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: ({
auth,
image,
platform
}: {
image: string
auth?: string | undefined
platform?: string | undefined
}) => Stream.Stream<MobySchemas.JSONMessage, MobyEndpoints.ImagesError, 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: ({
auth,
image,
platform
}: {
image: string
auth?: string | undefined
platform?: string | undefined
}) => Effect.Effect<
Stream.Stream<MobySchemas.JSONMessage, MobyEndpoints.ImagesError, never>,
never,
MobyEndpoints.Images | Scope.Scope
>
Since v1.0.0
push
Implements the docker push
command.
Signature
declare const push: (
options: Parameters<MobyEndpoints.Images["push"]>[0]
) => Stream.Stream<string, MobyEndpoints.ImagesError, MobyEndpoints.Images>
Since v1.0.0
run
Implements docker run
command.
Signature
declare const run: (
containerOptions: Parameters<MobyEndpoints.Containers["create"]>[0]
) => Effect.Effect<MobySchemas.ContainerInspectResponse, MobyEndpoints.ContainersError, 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: (
containerOptions: Parameters<MobyEndpoints.Containers["create"]>[0]
) => Effect.Effect<
MobySchemas.ContainerInspectResponse,
MobyEndpoints.ContainersError,
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.RegistrySearchResponse>, MobyEndpoints.ImagesError, MobyEndpoints.Images>
Since v1.0.0
start
Implements the docker start
command.
Signature
declare const start: (
containerId: string
) => Effect.Effect<void, MobyEndpoints.ContainersError, MobyEndpoints.Containers>
Since v1.0.0
stop
Implements the docker stop
command.
Signature
declare const stop: (
containerId: string
) => Effect.Effect<void, MobyEndpoints.ContainersError, MobyEndpoints.Containers>
Since v1.0.0
version
Implements the docker version
command.
Signature
declare const version: () => Effect.Effect<
Readonly<MobySchemas.SystemVersionResponse>,
MobyEndpoints.SystemsError,
MobyEndpoints.Systems
>
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.Systems
| 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