@zuke/docker
`@zuke/docker` — typed `DockerTasks` wrappers for the `docker` CLI.
@zuke/docker on JSR ↗ 52 symbols
Symbols
class DockerBuildSettings extends DockerSettings Settings for docker build.
| Member | Signature | Doc |
|---|---|---|
tag | tag(reference: string): this | Add an image tag (-t); repeatable. |
file | file(path: PathLike): this | Use an explicit Dockerfile (-f). |
target | target(stage: string): this | Build a specific stage (--target). |
platform | platform(value: string): this | Set the target platform(s) (--platform). |
buildArg | buildArg(key: string, value: string): this | Pass a build-time variable (--build-arg KEY=value); repeatable. |
noCache | noCache(): this | Do not use the layer cache (--no-cache). |
pull | pull(): this | Always attempt to pull newer base images (--pull). |
push | push(): this | Push the result to the registry after building (--push). |
context | context(path: PathLike): this | The build context path or URL (default .). |
class DockerCommitSettings extends DockerSettings Settings for docker commit.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container to snapshot (required). |
reference | reference(name: string): this | The image name to give the snapshot (positional). |
message | message(text: string): this | A commit message (-m/--message). |
author | author(value: string): this | The author to record (-a/--author). |
change | change(...instructions: string[]): this | Apply a Dockerfile instruction to the result (-c/--change); repeatable. |
noPause | noPause(): this | Leave the container running while it is committed (--pause=false). docker pauses it by default, which is what makes the snapshot consistent. |
interface DockerContainerEntry One container of docker ps --format '{{json .}}'.
| Member | Signature | Doc |
|---|---|---|
id? | id?: string | The container id, as docker abbreviates it in a listing. |
image? | image?: string | The image it was created from. |
names? | names?: string | Its names, comma-separated as docker reports them. |
command? | command?: string | The command it runs. |
status? | status?: string | A human description of its state, e.g. Up 3 minutes. |
state? | state?: string | The bare state, e.g. running or exited. |
ports? | ports?: string | The published ports, as docker formats them. |
class DockerContainerListSettings extends DockerSettings Base for the commands that act on one or more existing containers. The empty-list check is here so every one of them reports the same thing rather than letting docker print its usage.
| Member | Signature | Doc |
|---|---|---|
containers | containers(...names: string[]): this | Container names or ids to act on (required); repeatable. |
class DockerContainerSettings extends DockerProcessSettings Base for run and create, which configure a *new* container identically — docker's own run is create followed by start.
| Member | Signature | Doc |
|---|---|---|
image | image(reference: string): this | The image to run (required). |
name | name(value: string): this | Name the container (--name). |
rm | rm(): this | Remove the container when it exits (--rm). |
detach | detach(): this | Run in the background (-d). |
publish | publish(host: string | number, container: string | number): this | Publish a container port to the host (-p); repeatable. |
volume | volume(source: PathLike, target: PathLike): this | Mount a host path into the container (-v); repeatable. |
network | network(value: string): this | Attach the container to a network (--network). |
entrypoint | entrypoint(command: string): this | Override the image's entrypoint (--entrypoint). |
platform | platform(value: string): this | Run the image for a specific platform (--platform). |
pull | pull(policy: always | missing | never): this | When to pull the image (--pull=<always|missing|never>). |
restart | restart(policy: string): this | The restart policy (--restart), e.g. unless-stopped. |
label | label(key: string, value: string): this | Attach metadata to the container (--label); repeatable. |
class DockerContextSettings extends DockerSettings Settings for docker context. Pick the subcommand with create, ls, use, inspect, remove, or show.
| Member | Signature | Doc |
|---|---|---|
create | create(name: string): this | Create a context (context create <name>). |
ls | ls(): this | List contexts (context ls), the default. |
use | use(name: string): this | Make a context the default for later commands (context use <name>). |
inspect | inspect(...names: string[]): this | Describe contexts (context inspect [<name>...]). |
remove | remove(...names: string[]): this | Remove contexts (context rm <name>...). |
show | show(): this | Print the context in use (context show). |
dockerHost | dockerHost(address: string): this | The daemon a created context points at (--docker host=<address>). |
description | description(text: string): this | A human description for a created context (--description). |
from | from(name: string): this | Copy an existing context (--from <name>). |
format | format(template: string): this | Render each context through a Go template (--format). |
quietOutput | quietOutput(): this | Only print context names (-q/--quiet). |
force | force(): this | Remove even the context in use (-f/--force). |
class DockerCpSettings extends DockerSettings Settings for docker cp. Either end may be a container path (<container>:<path>) — which is what makes this the way a build gets an artifact out of a container that has already stopped.
| Member | Signature | Doc |
|---|---|---|
from | from(path: PathLike): this | The source, <container>:<path> or a host path (required). |
to | to(path: PathLike): this | The destination, <container>:<path> or a host path (required). |
archive | archive(): this | Keep uid/gid rather than mapping to the current user (-a/--archive). |
followLink | followLink(): this | Follow a symlink in the source (-L/--follow-link). |
class DockerCreateSettings extends DockerContainerSettings Settings for docker create.
class DockerDiffSettings extends DockerSettings Settings for docker diff.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container whose filesystem changes to show (required). |
class DockerExecSettings extends DockerProcessSettings Settings for docker exec.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container to run the command in (required). |
detach | detach(): this | Run the command in the background (-d). |
privileged | privileged(): this | Give the command extended privileges (--privileged). |
class DockerExportSettings extends DockerSettings Settings for docker export.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container whose filesystem to export (required). |
output | output(path: PathLike): this | Write to a file rather than stdout (-o/--output). |
class DockerHistorySettings extends DockerSettings Settings for docker history.
| Member | Signature | Doc |
|---|---|---|
image | image(reference: string): this | The image whose layers to show (required). |
noTrunc | noTrunc(): this | Print the full commands rather than eliding them (--no-trunc). |
quietOutput | quietOutput(): this | Only show layer ids (-q/--quiet). |
format | format(template: string): this | Render each layer through a Go template (--format). |
interface DockerImageEntry One image of docker images --format '{{json .}}'.
| Member | Signature | Doc |
|---|---|---|
id? | id?: string | The image id, as docker abbreviates it in a listing. |
repository? | repository?: string | The repository, or <none> for an untagged image. |
tag? | tag?: string | The tag, or <none> when the image carries none. |
createdSince? | createdSince?: string | How docker describes the image's age, e.g. 2 days ago. |
size? | size?: string | The on-disk size, as docker formats it. |
digest? | digest?: string | The digest, when the listing was asked for one. |
class DockerImagePruneSettings extends DockerSettings Settings for docker image prune.
| Member | Signature | Doc |
|---|---|---|
all | all(): this | Remove every unused image, not only the dangling ones (--all). This is the difference between reclaiming a little space and reclaiming a lot. |
force | force(): this | Do not prompt for confirmation (--force), which a build always needs. |
filter | filter(...expressions: string[]): this | Limit what is pruned (--filter), e.g. until=24h; repeatable. |
class DockerImagesSettings extends DockerSettings Settings for docker images.
| Member | Signature | Doc |
|---|---|---|
all | all(): this | Show all images, including intermediate layers (-a). |
quietOutput | quietOutput(): this | Only show image IDs (-q). |
filter | filter(expression: string): this | Filter the listing (--filter); repeatable. |
repository | repository(name: string): this | Restrict to a repository (positional argument). |
format | format(template: string): this | Render each image through a Go template (--format), e.g. {{json .}} for one JSON object per line. "./docker.ts".DockerTasks.imageEntries pins that form. |
digests | digests(): this | Also show each image's digest (--digests). |
class DockerImportSettings extends DockerSettings Settings for docker import.
| Member | Signature | Doc |
|---|---|---|
source | source(path: PathLike): this | The tarball to import (required); - reads it from stdin, as docker's own import does. |
reference | reference(name: string): this | The image name to give the result (positional). |
message | message(text: string): this | A commit message for the imported image (-m/--message). |
change | change(...instructions: string[]): this | Apply a Dockerfile instruction to the result (-c/--change); repeatable. |
platform | platform(value: string): this | The platform to import for (--platform). |
class DockerInfoSettings extends DockerSettings Settings for docker info.
| Member | Signature | Doc |
|---|---|---|
format | format(template: string): this | Render through a Go template (--format), e.g. {{json .}}. |
class DockerInspectSettings extends DockerSettings Settings for docker inspect.
| Member | Signature | Doc |
|---|---|---|
targets | targets(...names: string[]): this | The objects to inspect — containers, images, volumes (required). |
format | format(template: string): this | Render through a Go template (--format), e.g. {{.State.Status}} for one field, or {{json .}} for the whole record as JSON. |
type | type(kind: string): this | Only look for this kind of object (--type), e.g. container. |
size | size(): this | Include the disk usage of a container (-s/--size). |
class DockerKillSettings extends DockerContainerListSettings Settings for docker kill.
| Member | Signature | Doc |
|---|---|---|
signal | signal(name: string): this | The signal to send (-s/--signal); docker defaults to SIGKILL. |
class DockerLoadSettings extends DockerSettings Settings for docker load.
| Member | Signature | Doc |
|---|---|---|
input | input(path: PathLike): this | Read from a tar archive instead of STDIN (-i). |
quietOutput | quietOutput(): this | Suppress the load output (-q). |
class DockerLoginSettings extends DockerSettings Settings for docker login.
| Member | Signature | Doc |
|---|---|---|
username | username(value: string): this | The username (-u). |
password | password(value: string): this | The password (-p), which docker accepts and which therefore stays on the wrapper. Prefer passwordStdin. This flag puts the password in the child's argv, and a child's argv is world-readable on a default Linux host — through ps or /proc/<pid>/cmdline — to every other user on the machine and every process the build starts. On a shared or self-hosted runner that is every co-tenant. The value is registered with the run's redactor, so Zuke's own renderings of the command mask it. That does not cover the process table: the argv handed to the operating system is not redacted, and docker itself warns about -p for the same reason. Masking is what can be done here, not a fix for the exposure. |
passwordStdin | passwordStdin(token: string): this | Pipe the password to docker through STDIN (--password-stdin), which keeps it off the command line entirely. This is the route docker documents for exactly this reason, and the one to use in CI. The token goes to the child's standard input, which — unlike its argv — no other process on the host can read. The password is required, because the flag on its own means nothing: it tells docker to read standard input, and this wrapper is what has to put something there. A --password-stdin with no writer leaves docker reading a stream that is never written. |
registry | registry(server: string): this | The registry server (defaults to Docker Hub). |
type DockerLogLevel = debug | info | warn | error | fatal How verbose the docker client is (--log-level).
class DockerLogoutSettings extends DockerSettings Settings for docker logout.
| Member | Signature | Doc |
|---|---|---|
registry | registry(server: string): this | The registry to forget (positional); defaults to Docker Hub. |
class DockerLogsSettings extends DockerSettings Settings for docker logs.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container whose logs to read (required). |
follow | follow(): this | Keep streaming (-f/--follow). A target that follows logs never returns on its own — pair it with .killAfter(...) from the tooling base, or with a container that exits. |
tail | tail(lines: number | all): this | Show only the last N lines (--tail), or all. |
since | since(when: string): this | Only logs since this timestamp or relative time (--since), e.g. 10m. |
until | until(when: string): this | Only logs before this timestamp or relative time (--until). |
timestamps | timestamps(): this | Prefix each line with its timestamp (-t/--timestamps). |
details | details(): this | Include the extra attributes docker records (--details). |
class DockerNetworkSettings extends DockerSettings Settings for docker network. Pick the subcommand with create, ls, remove, inspect, connect, disconnect, or prune.
| Member | Signature | Doc |
|---|---|---|
create | create(name: string): this | Create a network (network create <name>). |
ls | ls(): this | List networks (network ls), the default. |
remove | remove(...names: string[]): this | Remove networks (network rm <name>...). |
inspect | inspect(...names: string[]): this | Describe networks (network inspect <name>...). |
connect | connect(network: string, container: string): this | Attach a container to a network (network connect <net> <container>). |
disconnect | disconnect(network: string, container: string): this | Detach a container (network disconnect <net> <container>). |
prune | prune(): this | Remove the networks nothing uses (network prune). |
driver | driver(name: string): this | The network driver (--driver), e.g. bridge. |
subnet | subnet(cidr: string): this | The subnet in CIDR form (--subnet). |
gateway | gateway(address: string): this | The gateway address (--gateway). |
label | label(key: string, value: string): this | Attach metadata (--label); repeatable. |
alias | alias(name: string): this | An extra name the container answers to on this network (--alias). |
filter | filter(...expressions: string[]): this | Filter a listing or a prune (--filter); repeatable. |
format | format(template: string): this | Render each network through a Go template (--format). "./docker.ts".DockerTasks.networkNames pins {{.Name}}. |
quietOutput | quietOutput(): this | Only print network ids (-q/--quiet). |
force | force(): this | Do not prompt for confirmation (--force). |
class DockerPauseSettings extends DockerContainerListSettings Settings for docker pause.
class DockerPortSettings extends DockerSettings Settings for docker port.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container whose port mappings to show (required). |
port | port(value: string | number): this | A single private port to resolve, e.g. 8080/tcp. |
class DockerProcessSettings extends DockerSettings Base for the commands that run a process — run, create, and exec — carrying the flags all three accept.
| Member | Signature | Doc |
|---|---|---|
interactive | interactive(): this | Keep stdin open (-i). |
tty | tty(): this | Allocate a pseudo-TTY (-t). |
envVar | envVar(key: string, value: string): this | Set an environment variable (-e); repeatable. |
envFile | envFile(...paths: PathLike[]): this | Read environment variables from a file (--env-file); repeatable. |
workdir | workdir(path: PathLike): this | Set the working directory inside the container (-w). |
user | user(value: string): this | Run as this user or uid:gid (-u/--user). |
commandArgs | commandArgs(...args: Array<string | number>): this | The command and arguments to run inside the container. |
class DockerPsSettings extends DockerSettings Settings for docker ps.
| Member | Signature | Doc |
|---|---|---|
all | all(): this | Show stopped containers too (-a). |
quietOutput | quietOutput(): this | Only show container IDs (-q). |
filter | filter(expression: string): this | Filter the listing (--filter); repeatable. |
format | format(template: string): this | Render each container through a Go template (--format), e.g. {{json .}} for one JSON object per line. "./docker.ts".DockerTasks.psEntries pins that form. |
latest | latest(): this | Show only the most recently created container (-l/--latest). |
noTrunc | noTrunc(): this | Print ids and commands in full (--no-trunc). |
size | size(): this | Include each container's disk usage (-s/--size). |
class DockerPullSettings extends DockerSettings Settings for docker pull.
| Member | Signature | Doc |
|---|---|---|
image | image(reference: string): this | The image reference to pull (required). |
platform | platform(value: string): this | Pull a specific platform (--platform). |
quietOutput | quietOutput(): this | Suppress verbose output (-q). |
class DockerPushSettings extends DockerSettings Settings for docker push.
| Member | Signature | Doc |
|---|---|---|
image | image(reference: string): this | The image reference to push (required). |
allTags | allTags(): this | Push every tag of the repository (--all-tags). |
class DockerRenameSettings extends DockerSettings Settings for docker rename.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container to rename (required). |
newName | newName(name: string): this | Its new name (required). |
class DockerRestartSettings extends DockerContainerListSettings Settings for docker restart.
| Member | Signature | Doc |
|---|---|---|
timeout | timeout(seconds: number): this | Seconds to wait before killing the container (-t/--time). |
signal | signal(name: string): this | The signal to send first (-s/--signal). |
class DockerRmiSettings extends DockerSettings Settings for docker rmi.
| Member | Signature | Doc |
|---|---|---|
images | images(...references: string[]): this | The images to remove (at least one is required). |
force | force(): this | Force removal (-f). |
class DockerRmSettings extends DockerContainerListSettings Settings for docker rm.
| Member | Signature | Doc |
|---|---|---|
force | force(): this | Force removal of a running container (-f). |
volumes | volumes(): this | Also remove anonymous volumes (-v). |
class DockerRunSettings extends DockerContainerSettings Settings for docker run.
class DockerSaveSettings extends DockerSettings Settings for docker save.
| Member | Signature | Doc |
|---|---|---|
images | images(...references: string[]): this | The images to save (at least one is required). |
output | output(path: PathLike): this | Write to a file instead of STDOUT (-o). |
class DockerSearchSettings extends DockerSettings Settings for docker search.
| Member | Signature | Doc |
|---|---|---|
term | term(value: string): this | What to search Docker Hub for (required). |
limit | limit(count: number): this | Cap the number of results (--limit). |
filter | filter(...expressions: string[]): this | Filter the results (--filter), e.g. is-official=true; repeatable. |
format | format(template: string): this | Render each result through a Go template (--format). |
noTrunc | noTrunc(): this | Print descriptions in full (--no-trunc). |
class DockerSettings extends ToolSettings Shared base for every docker subcommand: the binary and global options.
| Member | Signature | Doc |
|---|---|---|
dockerContext | dockerContext(name: string): this | Use a named docker context (--context), which is how a build talks to a remote daemon or a second local one without exporting DOCKER_HOST. Named dockerContext rather than context because docker build's trailing PATH is *also* called a context, and "./build.ts".DockerBuildSettings.context already means that one. |
host | host(address: string): this | The daemon socket to connect to (--host), e.g. ssh://build@host. |
logLevel | logLevel(level: DockerLogLevel): this | How much the client logs (--log-level). |
config | config(path: PathLike): this | Where the client config lives (--config). |
debug | debug(): this | Enable client debug output (--debug). |
class DockerStartSettings extends DockerContainerListSettings Settings for docker start.
| Member | Signature | Doc |
|---|---|---|
attach | attach(): this | Attach STDOUT/STDERR and forward signals (-a). |
class DockerStatsSettings extends DockerSettings Settings for docker stats.
| Member | Signature | Doc |
|---|---|---|
containers | containers(...names: string[]): this | Limit the report to these containers; omit for all running ones. |
all | all(): this | Include stopped containers (-a/--all). |
format | format(template: string): this | Render through a Go template (--format). |
class DockerStopSettings extends DockerContainerListSettings Settings for docker stop.
| Member | Signature | Doc |
|---|---|---|
time | time(seconds: number): this | Seconds to wait before killing (-t). |
class DockerSystemSettings extends DockerSettings Settings for docker system. Pick the subcommand with prune, df, or info.
| Member | Signature | Doc |
|---|---|---|
prune | prune(): this | Reclaim space (system prune). |
df | df(): this | Report what is using disk (system df). |
info | info(): this | Describe the daemon (system info). |
all | all(): this | Prune every unused image, not only the dangling ones (--all) — the difference between reclaiming a little space and reclaiming a lot. |
force | force(): this | Do not prompt for confirmation (--force), which a build always needs. |
volumes | volumes(): this | Also remove unused volumes (--volumes), which a prune otherwise keeps. |
filter | filter(...expressions: string[]): this | Limit what is pruned (--filter), e.g. until=24h; repeatable. |
verbose | verbose(): this | Break the df report down per object (-v/--verbose). |
format | format(template: string): this | Render through a Go template (--format). |
class DockerTagSettings extends DockerSettings Settings for docker tag.
| Member | Signature | Doc |
|---|---|---|
source | source(reference: string): this | The existing image reference (required). |
target | target(reference: string): this | The new image reference (required). |
const DockerTasks: DockerTasksApi Typed task functions for the docker CLI.
interface DockerTasksApi The shape of DockerTasks.
| Member | Signature | Doc |
|---|---|---|
build | build(configure?: Configure<DockerBuildSettings>): Promise<CommandOutput> | Build an image: docker build. |
run | run(configure?: Configure<DockerRunSettings>): Promise<CommandOutput> | Run a container: docker run. |
create | create(configure?: Configure<DockerCreateSettings>): Promise<CommandOutput> | Create a container without starting it: docker create. |
exec | exec(configure?: Configure<DockerExecSettings>): Promise<CommandOutput> | Run a command in a container: docker exec. |
start | start(configure?: Configure<DockerStartSettings>): Promise<CommandOutput> | Start containers: docker start. |
stop | stop(configure?: Configure<DockerStopSettings>): Promise<CommandOutput> | Stop containers: docker stop. |
restart | restart(configure?: Configure<DockerRestartSettings>): Promise<CommandOutput> | Restart containers: docker restart. |
kill | kill(configure?: Configure<DockerKillSettings>): Promise<CommandOutput> | Signal containers: docker kill. |
pause | pause(configure?: Configure<DockerPauseSettings>): Promise<CommandOutput> | Suspend a container's processes: docker pause. |
unpause | unpause(configure?: Configure<DockerUnpauseSettings>): Promise<CommandOutput> | Resume them: docker unpause. |
rm | rm(configure?: Configure<DockerRmSettings>): Promise<CommandOutput> | Remove containers: docker rm. |
wait | wait(configure?: Configure<DockerWaitSettings>): Promise<CommandOutput> | Block until containers stop, then print their exit codes: docker wait — how a build gets a test container's result rather than the runner's. |
rename | rename(configure?: Configure<DockerRenameSettings>): Promise<CommandOutput> | Rename a container: docker rename. |
update | update(configure?: Configure<DockerUpdateSettings>): Promise<CommandOutput> | Change a container's resource limits: docker update. |
ps | ps(configure?: Configure<DockerPsSettings>): Promise<CommandOutput> | List containers: docker ps. |
psEntries | psEntries(configure?: Configure<DockerPsSettings>): Promise<DockerContainerEntry[]> | The containers as parsed DockerContainerEntry values, from docker ps --format '{{json .}}'. |
logs | logs(configure?: Configure<DockerLogsSettings>): Promise<CommandOutput> | Read a container's logs: docker logs. |
inspect | inspect(configure?: Configure<DockerInspectSettings>): Promise<CommandOutput> | Describe docker objects: docker inspect. |
top | top(configure?: Configure<DockerTopSettings>): Promise<CommandOutput> | List a container's processes: docker top. |
stats | stats(configure?: Configure<DockerStatsSettings>): Promise<CommandOutput> | Sample resource usage once: docker stats --no-stream. |
port | port(configure?: Configure<DockerPortSettings>): Promise<CommandOutput> | Show a container's port mappings: docker port. |
diff | diff(configure?: Configure<DockerDiffSettings>): Promise<CommandOutput> | Show a container's filesystem changes: docker diff. |
cp | cp(configure?: Configure<DockerCpSettings>): Promise<CommandOutput> | Copy files between a container and the host: docker cp. |
commit | commit(configure?: Configure<DockerCommitSettings>): Promise<CommandOutput> | Turn a container into an image: docker commit. |
export | export(configure?: Configure<DockerExportSettings>): Promise<CommandOutput> | Export a container's filesystem: docker export. |
images | images(configure?: Configure<DockerImagesSettings>): Promise<CommandOutput> | List images: docker images. |
imageEntries | imageEntries(configure?: Configure<DockerImagesSettings>): Promise<DockerImageEntry[]> | The images as parsed DockerImageEntry values, from docker images --format '{{json .}}'. |
pull | pull(configure?: Configure<DockerPullSettings>): Promise<CommandOutput> | Pull an image: docker pull. |
push | push(configure?: Configure<DockerPushSettings>): Promise<CommandOutput> | Push an image: docker push. |
tag | tag(configure?: Configure<DockerTagSettings>): Promise<CommandOutput> | Tag an image: docker tag. |
rmi | rmi(configure?: Configure<DockerRmiSettings>): Promise<CommandOutput> | Remove images: docker rmi. |
save | save(configure?: Configure<DockerSaveSettings>): Promise<CommandOutput> | Save images to a tar archive: docker save. |
load | load(configure?: Configure<DockerLoadSettings>): Promise<CommandOutput> | Load images from a tar archive: docker load. |
history | history(configure?: Configure<DockerHistorySettings>): Promise<CommandOutput> | Show an image's layers: docker history. |
import | import(configure?: Configure<DockerImportSettings>): Promise<CommandOutput> | Create an image from a tarball: docker import. |
imagePrune | imagePrune(configure?: Configure<DockerImagePruneSettings>): Promise<CommandOutput> | Remove unused images: docker image prune. |
login | login(configure?: Configure<DockerLoginSettings>): Promise<CommandOutput> | Authenticate to a registry: docker login. |
logout | logout(configure?: Configure<DockerLogoutSettings>): Promise<CommandOutput> | Forget a registry's credentials: docker logout. |
search | search(configure?: Configure<DockerSearchSettings>): Promise<CommandOutput> | Search Docker Hub: docker search. |
info | info(configure?: Configure<DockerInfoSettings>): Promise<CommandOutput> | Describe the daemon: docker info. |
version | version(configure?: Configure<DockerVersionSettings>): Promise<CommandOutput> | Report client and daemon versions: docker version. |
system | system(configure?: Configure<DockerSystemSettings>): Promise<CommandOutput> | Reclaim space or report usage: docker system prune|df|info. |
volume | volume(configure?: Configure<DockerVolumeSettings>): Promise<CommandOutput> | Manage volumes: docker volume create|ls|rm|inspect|prune. |
volumeNames | volumeNames(configure?: Configure<DockerVolumeSettings>): Promise<string[]> | The volume names, from docker volume ls --format '{{.Name}}'. |
network | network(configure?: Configure<DockerNetworkSettings>): Promise<CommandOutput> | Manage networks: docker network create|ls|rm|inspect|connect|…. |
networkNames | networkNames(configure?: Configure<DockerNetworkSettings>): Promise<string[]> | The network names, from docker network ls --format '{{.Name}}'. |
context | context(configure?: Configure<DockerContextSettings>): Promise<CommandOutput> | Manage the daemons to talk to: docker context create|ls|use|…. |
class DockerTopSettings extends DockerSettings Settings for docker top.
| Member | Signature | Doc |
|---|---|---|
container | container(name: string): this | The container whose processes to list (required). |
psArgs | psArgs(...args: string[]): this | Arguments passed through to ps inside the container. |
class DockerUnpauseSettings extends DockerContainerListSettings Settings for docker unpause.
class DockerUpdateSettings extends DockerContainerListSettings Settings for docker update.
| Member | Signature | Doc |
|---|---|---|
memory | memory(limit: string): this | The memory limit (--memory), e.g. 512m. |
cpus | cpus(count: string): this | How many CPUs the container may use (--cpus). |
restart | restart(policy: string): this | The restart policy (--restart). |
class DockerVersionSettings extends DockerSettings Settings for docker version.
| Member | Signature | Doc |
|---|---|---|
format | format(template: string): this | Render through a Go template (--format), e.g. {{.Server.Version}} to read just the daemon's version. |
class DockerVolumeSettings extends DockerSettings Settings for docker volume. Pick the subcommand with create, ls, remove, inspect, or prune.
| Member | Signature | Doc |
|---|---|---|
create | create(name?: string): this | Create a volume (volume create [<name>]). |
ls | ls(): this | List volumes (volume ls), the default. |
remove | remove(...names: string[]): this | Remove volumes (volume rm <name>...). |
inspect | inspect(...names: string[]): this | Describe volumes (volume inspect <name>...). |
prune | prune(): this | Remove the volumes nothing uses (volume prune). |
driver | driver(name: string): this | The volume driver (--driver), for a created volume. |
label | label(key: string, value: string): this | Attach metadata (--label); repeatable. |
opt | opt(key: string, value: string): this | A driver-specific option (--opt); repeatable. |
filter | filter(...expressions: string[]): this | Filter a listing or a prune (--filter); repeatable. |
format | format(template: string): this | Render each volume through a Go template (--format). "./docker.ts".DockerTasks.volumeNames pins {{.Name}}. |
quietOutput | quietOutput(): this | Only print volume names (-q/--quiet). |
force | force(): this | Do not prompt, and remove even a volume in use where docker allows it (--force). |
all | all(): this | Prune anonymous *and* named volumes (--all), not only anonymous ones. |
class DockerWaitSettings extends DockerContainerListSettings Settings for docker wait — blocking until the containers stop, then printing their exit codes, which is how a build gets a test container's result rather than the runner's.