zuke.tools.docker

← Python API reference

@zuke/docker 1.1.1: @zuke/docker — typed DockerTasks wrappers for the docker CLI.

Symbols

#

DockerBuildSettings

class
class DockerBuildSettings(DockerSettings)

Settings for docker build.

  • tag(reference: str) -> Self

    Add an image tag (-t); repeatable.

  • file(path: str) -> Self

    Use an explicit Dockerfile (-f).

  • target(stage: str) -> Self

    Build a specific stage (--target).

  • platform(value: str) -> Self

    Set the target platform(s) (--platform).

  • build_arg(key: str, value: str) -> Self

    Pass a build-time variable (--build-arg KEY=value); repeatable.

  • no_cache() -> Self

    Do not use the layer cache (--no-cache).

  • pull() -> Self

    Always attempt to pull newer base images (--pull).

  • push() -> Self

    Push the result to the registry after building (--push).

  • context(path: str) -> Self

    The build context path or URL (default .).

#

DockerCommitSettings

class
class DockerCommitSettings(DockerSettings)

Settings for docker commit.

  • container(name: str) -> Self

    The container to snapshot (required).

  • reference(name: str) -> Self

    The image name to give the snapshot (positional).

  • message(text: str) -> Self

    A commit message (-m/--message).

  • author(value: str) -> Self

    The author to record (-a/--author).

  • change(*instructions: str) -> Self

    Apply a Dockerfile instruction to the result (-c/--change); repeatable.

  • no_pause() -> Self

    Leave the container running while it is committed (--pause=false). docker pauses it by default, which is what makes the snapshot consistent.

#

DockerContainerListSettings

class
class DockerContainerListSettings(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.

  • containers(*names: str) -> Self

    Container names or ids to act on (required); repeatable.

#

DockerContainerSettings

class
class DockerContainerSettings(DockerProcessSettings)

Base for run and create, which configure a *new* container identically — docker's own run is create followed by start.

  • image(reference: str) -> Self

    The image to run (required).

  • name(value: str) -> Self

    Name the container (--name).

  • rm() -> Self

    Remove the container when it exits (--rm).

  • detach() -> Self

    Run in the background (-d).

  • publish(host: str | float, container: str | float) -> Self

    Publish a container port to the host (-p); repeatable.

  • volume(source: str, target: str) -> Self

    Mount a host path into the container (-v); repeatable.

  • network(value: str) -> Self

    Attach the container to a network (--network).

  • entrypoint(command: str) -> Self

    Override the image's entrypoint (--entrypoint).

  • platform(value: str) -> Self

    Run the image for a specific platform (--platform).

  • pull(policy: Literal['always', 'missing', 'never']) -> Self

    When to pull the image (--pull=<always|missing|never>).

  • restart(policy: str) -> Self

    The restart policy (--restart), e.g. unless-stopped.

  • label(key: str, value: str) -> Self

    Attach metadata to the container (--label); repeatable.

#

DockerContextSettings

class
class DockerContextSettings(DockerSettings)

Settings for docker context. Pick the subcommand with create, ls, use, inspect, remove, or show.

  • create(name: str) -> Self

    Create a context (context create <name>).

  • ls() -> Self

    List contexts (context ls), the default.

  • use(name: str) -> Self

    Make a context the default for later commands (context use <name>).

  • inspect(*names: str) -> Self

    Describe contexts (context inspect [<name>...]).

  • remove(*names: str) -> Self

    Remove contexts (context rm <name>...).

  • show() -> Self

    Print the context in use (context show).

  • docker_host(address: str) -> Self

    The daemon a created context points at (--docker host=<address>).

  • description(text: str) -> Self

    A human description for a created context (--description).

  • from_(name: str) -> Self

    Copy an existing context (--from <name>).

  • format(template: str) -> Self

    Render each context through a Go template (--format).

  • quiet_output() -> Self

    Only print context names (-q/--quiet).

  • force() -> Self

    Remove even the context in use (-f/--force).

#

DockerCpSettings

class
class DockerCpSettings(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.

  • from_(path: str) -> Self

    The source, <container>:<path> or a host path (required).

  • to(path: str) -> Self

    The destination, <container>:<path> or a host path (required).

  • archive() -> Self

    Keep uid/gid rather than mapping to the current user (-a/--archive).

  • follow_link() -> Self

    Follow a symlink in the source (-L/--follow-link).

#

DockerCreateSettings

class
class DockerCreateSettings(DockerContainerSettings)

Settings for docker create.

#

DockerDiffSettings

class
class DockerDiffSettings(DockerSettings)

Settings for docker diff.

  • container(name: str) -> Self

    The container whose filesystem changes to show (required).

#

DockerExecSettings

class
class DockerExecSettings(DockerProcessSettings)

Settings for docker exec.

  • container(name: str) -> Self

    The container to run the command in (required).

  • detach() -> Self

    Run the command in the background (-d).

  • privileged() -> Self

    Give the command extended privileges (--privileged).

#

DockerExportSettings

class
class DockerExportSettings(DockerSettings)

Settings for docker export.

  • container(name: str) -> Self

    The container whose filesystem to export (required).

  • output(path: str) -> Self

    Write to a file rather than stdout (-o/--output).

#

DockerHistorySettings

class
class DockerHistorySettings(DockerSettings)

Settings for docker history.

  • image(reference: str) -> Self

    The image whose layers to show (required).

  • no_trunc() -> Self

    Print the full commands rather than eliding them (--no-trunc).

  • quiet_output() -> Self

    Only show layer ids (-q/--quiet).

  • format(template: str) -> Self

    Render each layer through a Go template (--format).

#

DockerImagePruneSettings

class
class DockerImagePruneSettings(DockerSettings)

Settings for docker image prune.

  • all() -> Self

    Remove every unused image, not only the dangling ones (--all). This is the difference between reclaiming a little space and reclaiming a lot.

  • force() -> Self

    Do not prompt for confirmation (--force), which a build always needs.

  • filter(*expressions: str) -> Self

    Limit what is pruned (--filter), e.g. until=24h; repeatable.

#

DockerImagesSettings

class
class DockerImagesSettings(DockerSettings)

Settings for docker images.

  • all() -> Self

    Show all images, including intermediate layers (-a).

  • quiet_output() -> Self

    Only show image IDs (-q).

  • filter(expression: str) -> Self

    Filter the listing (--filter); repeatable.

  • repository(name: str) -> Self

    Restrict to a repository (positional argument).

  • format(template: str) -> Self

    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() -> Self

    Also show each image's digest (--digests).

#

DockerImportSettings

class
class DockerImportSettings(DockerSettings)

Settings for docker import.

  • source(path: str) -> Self

    The tarball to import (required); - reads it from stdin, as docker's own import does.

  • reference(name: str) -> Self

    The image name to give the result (positional).

  • message(text: str) -> Self

    A commit message for the imported image (-m/--message).

  • change(*instructions: str) -> Self

    Apply a Dockerfile instruction to the result (-c/--change); repeatable.

  • platform(value: str) -> Self

    The platform to import for (--platform).

#

DockerInfoSettings

class
class DockerInfoSettings(DockerSettings)

Settings for docker info.

  • format(template: str) -> Self

    Render through a Go template (--format), e.g. {{json .}}.

#

DockerInspectSettings

class
class DockerInspectSettings(DockerSettings)

Settings for docker inspect.

  • targets(*names: str) -> Self

    The objects to inspect — containers, images, volumes (required).

  • format(template: str) -> Self

    Render through a Go template (--format), e.g. {{.State.Status}} for one field, or {{json .}} for the whole record as JSON.

  • type_(kind: str) -> Self

    Only look for this kind of object (--type), e.g. container.

  • size() -> Self

    Include the disk usage of a container (-s/--size).

#

DockerKillSettings

class
class DockerKillSettings(DockerContainerListSettings)

Settings for docker kill.

  • signal(name: str) -> Self

    The signal to send (-s/--signal); docker defaults to SIGKILL.

#

DockerLoadSettings

class
class DockerLoadSettings(DockerSettings)

Settings for docker load.

  • input(path: str) -> Self

    Read from a tar archive instead of STDIN (-i).

  • quiet_output() -> Self

    Suppress the load output (-q).

#

DockerLoginSettings

class
class DockerLoginSettings(DockerSettings)

Settings for docker login.

  • username(value: str) -> Self

    The username (-u).

  • password(value: str) -> Self

    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.

  • password_stdin(token: str) -> Self

    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(server: str) -> Self

    The registry server (defaults to Docker Hub).

#

DockerLogoutSettings

class
class DockerLogoutSettings(DockerSettings)

Settings for docker logout.

  • registry(server: str) -> Self

    The registry to forget (positional); defaults to Docker Hub.

#

DockerLogsSettings

class
class DockerLogsSettings(DockerSettings)

Settings for docker logs.

  • container(name: str) -> Self

    The container whose logs to read (required).

  • follow() -> Self

    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(lines: Literal['all'] | float) -> Self

    Show only the last N lines (--tail), or all.

  • since(when: str) -> Self

    Only logs since this timestamp or relative time (--since), e.g. 10m.

  • until(when: str) -> Self

    Only logs before this timestamp or relative time (--until).

  • timestamps() -> Self

    Prefix each line with its timestamp (-t/--timestamps).

  • details() -> Self

    Include the extra attributes docker records (--details).

#

DockerNetworkSettings

class
class DockerNetworkSettings(DockerSettings)

Settings for docker network. Pick the subcommand with create, ls, remove, inspect, connect, disconnect, or prune.

  • create(name: str) -> Self

    Create a network (network create <name>).

  • ls() -> Self

    List networks (network ls), the default.

  • remove(*names: str) -> Self

    Remove networks (network rm <name>...).

  • inspect(*names: str) -> Self

    Describe networks (network inspect <name>...).

  • connect(network: str, container: str) -> Self

    Attach a container to a network (network connect <net> <container>).

  • disconnect(network: str, container: str) -> Self

    Detach a container (network disconnect <net> <container>).

  • prune() -> Self

    Remove the networks nothing uses (network prune).

  • driver(name: str) -> Self

    The network driver (--driver), e.g. bridge.

  • subnet(cidr: str) -> Self

    The subnet in CIDR form (--subnet).

  • gateway(address: str) -> Self

    The gateway address (--gateway).

  • label(key: str, value: str) -> Self

    Attach metadata (--label); repeatable.

  • alias(name: str) -> Self

    An extra name the container answers to on this network (--alias).

  • filter(*expressions: str) -> Self

    Filter a listing or a prune (--filter); repeatable.

  • format(template: str) -> Self

    Render each network through a Go template (--format). "./docker.ts".DockerTasks.networkNames pins {{.Name}}.

  • quiet_output() -> Self

    Only print network ids (-q/--quiet).

  • force() -> Self

    Do not prompt for confirmation (--force).

#

DockerPauseSettings

class
class DockerPauseSettings(DockerContainerListSettings)

Settings for docker pause.

#

DockerPortSettings

class
class DockerPortSettings(DockerSettings)

Settings for docker port.

  • container(name: str) -> Self

    The container whose port mappings to show (required).

  • port(value: str | float) -> Self

    A single private port to resolve, e.g. 8080/tcp.

#

DockerProcessSettings

class
class DockerProcessSettings(DockerSettings)

Base for the commands that run a process — run, create, and exec — carrying the flags all three accept.

  • interactive() -> Self

    Keep stdin open (-i).

  • tty() -> Self

    Allocate a pseudo-TTY (-t).

  • env_var(key: str, value: str) -> Self

    Set an environment variable (-e); repeatable.

  • env_file(*paths: str) -> Self

    Read environment variables from a file (--env-file); repeatable.

  • workdir(path: str) -> Self

    Set the working directory inside the container (-w).

  • user(value: str) -> Self

    Run as this user or uid:gid (-u/--user).

  • command_args(*args: str | float) -> Self

    The command and arguments to run inside the container.

#

DockerPsSettings

class
class DockerPsSettings(DockerSettings)

Settings for docker ps.

  • all() -> Self

    Show stopped containers too (-a).

  • quiet_output() -> Self

    Only show container IDs (-q).

  • filter(expression: str) -> Self

    Filter the listing (--filter); repeatable.

  • format(template: str) -> Self

    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() -> Self

    Show only the most recently created container (-l/--latest).

  • no_trunc() -> Self

    Print ids and commands in full (--no-trunc).

  • size() -> Self

    Include each container's disk usage (-s/--size).

#

DockerPullSettings

class
class DockerPullSettings(DockerSettings)

Settings for docker pull.

  • image(reference: str) -> Self

    The image reference to pull (required).

  • platform(value: str) -> Self

    Pull a specific platform (--platform).

  • quiet_output() -> Self

    Suppress verbose output (-q).

#

DockerPushSettings

class
class DockerPushSettings(DockerSettings)

Settings for docker push.

  • image(reference: str) -> Self

    The image reference to push (required).

  • all_tags() -> Self

    Push every tag of the repository (--all-tags).

#

DockerRenameSettings

class
class DockerRenameSettings(DockerSettings)

Settings for docker rename.

  • container(name: str) -> Self

    The container to rename (required).

  • new_name(name: str) -> Self

    Its new name (required).

#

DockerRestartSettings

class
class DockerRestartSettings(DockerContainerListSettings)

Settings for docker restart.

  • timeout(seconds: float) -> Self

    Seconds to wait before killing the container (-t/--time).

  • signal(name: str) -> Self

    The signal to send first (-s/--signal).

#

DockerRmiSettings

class
class DockerRmiSettings(DockerSettings)

Settings for docker rmi.

  • images(*references: str) -> Self

    The images to remove (at least one is required).

  • force() -> Self

    Force removal (-f).

#

DockerRmSettings

class
class DockerRmSettings(DockerContainerListSettings)

Settings for docker rm.

  • force() -> Self

    Force removal of a running container (-f).

  • volumes() -> Self

    Also remove anonymous volumes (-v).

#

DockerRunSettings

class
class DockerRunSettings(DockerContainerSettings)

Settings for docker run.

#

DockerSaveSettings

class
class DockerSaveSettings(DockerSettings)

Settings for docker save.

  • images(*references: str) -> Self

    The images to save (at least one is required).

  • output(path: str) -> Self

    Write to a file instead of STDOUT (-o).

#

DockerSearchSettings

class
class DockerSearchSettings(DockerSettings)

Settings for docker search.

  • term(value: str) -> Self

    What to search Docker Hub for (required).

  • limit(count: float) -> Self

    Cap the number of results (--limit).

  • filter(*expressions: str) -> Self

    Filter the results (--filter), e.g. is-official=true; repeatable.

  • format(template: str) -> Self

    Render each result through a Go template (--format).

  • no_trunc() -> Self

    Print descriptions in full (--no-trunc).

#

DockerSettings

class
class DockerSettings(ToolSettings)

Shared base for every docker subcommand: the binary and global options.

  • docker_context(name: str) -> Self

    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(address: str) -> Self

    The daemon socket to connect to (--host), e.g. ssh://build@host.

  • log_level(level: Literal['debug', 'info', 'warn', 'error', 'fatal']) -> Self

    How much the client logs (--log-level).

  • config(path: str) -> Self

    Where the client config lives (--config).

  • debug() -> Self

    Enable client debug output (--debug).

#

DockerStartSettings

class
class DockerStartSettings(DockerContainerListSettings)

Settings for docker start.

  • attach() -> Self

    Attach STDOUT/STDERR and forward signals (-a).

#

DockerStatsSettings

class
class DockerStatsSettings(DockerSettings)

Settings for docker stats.

  • containers(*names: str) -> Self

    Limit the report to these containers; omit for all running ones.

  • all() -> Self

    Include stopped containers (-a/--all).

  • format(template: str) -> Self

    Render through a Go template (--format).

#

DockerStopSettings

class
class DockerStopSettings(DockerContainerListSettings)

Settings for docker stop.

  • time(seconds: float) -> Self

    Seconds to wait before killing (-t).

#

DockerSystemSettings

class
class DockerSystemSettings(DockerSettings)

Settings for docker system. Pick the subcommand with prune, df, or info.

  • prune() -> Self

    Reclaim space (system prune).

  • df() -> Self

    Report what is using disk (system df).

  • info() -> Self

    Describe the daemon (system info).

  • all() -> Self

    Prune every unused image, not only the dangling ones (--all) — the difference between reclaiming a little space and reclaiming a lot.

  • force() -> Self

    Do not prompt for confirmation (--force), which a build always needs.

  • volumes() -> Self

    Also remove unused volumes (--volumes), which a prune otherwise keeps.

  • filter(*expressions: str) -> Self

    Limit what is pruned (--filter), e.g. until=24h; repeatable.

  • verbose() -> Self

    Break the df report down per object (-v/--verbose).

  • format(template: str) -> Self

    Render through a Go template (--format).

#

DockerTagSettings

class
class DockerTagSettings(DockerSettings)

Settings for docker tag.

  • source(reference: str) -> Self

    The existing image reference (required).

  • target(reference: str) -> Self

    The new image reference (required).

#

DockerTasks

class
class DockerTasks

Typed task functions for the docker CLI.

  • static async build(ctx: ServiceContext, configure: Callable[[DockerBuildSettings], DockerBuildSettings] | None=None) -> ExecResult

    Build an image: docker build.

  • static async run(ctx: ServiceContext, configure: Callable[[DockerRunSettings], DockerRunSettings] | None=None) -> ExecResult

    Run a container: docker run.

  • static async create(ctx: ServiceContext, configure: Callable[[DockerCreateSettings], DockerCreateSettings] | None=None) -> ExecResult

    Create a container without starting it: docker create.

  • static async exec(ctx: ServiceContext, configure: Callable[[DockerExecSettings], DockerExecSettings] | None=None) -> ExecResult

    Run a command in a container: docker exec.

  • static async start(ctx: ServiceContext, configure: Callable[[DockerStartSettings], DockerStartSettings] | None=None) -> ExecResult

    Start containers: docker start.

  • static async stop(ctx: ServiceContext, configure: Callable[[DockerStopSettings], DockerStopSettings] | None=None) -> ExecResult

    Stop containers: docker stop.

  • static async restart(ctx: ServiceContext, configure: Callable[[DockerRestartSettings], DockerRestartSettings] | None=None) -> ExecResult

    Restart containers: docker restart.

  • static async kill(ctx: ServiceContext, configure: Callable[[DockerKillSettings], DockerKillSettings] | None=None) -> ExecResult

    Signal containers: docker kill.

  • static async pause(ctx: ServiceContext, configure: Callable[[DockerPauseSettings], DockerPauseSettings] | None=None) -> ExecResult

    Suspend a container's processes: docker pause.

  • static async unpause(ctx: ServiceContext, configure: Callable[[DockerUnpauseSettings], DockerUnpauseSettings] | None=None) -> ExecResult

    Resume them: docker unpause.

  • static async rm(ctx: ServiceContext, configure: Callable[[DockerRmSettings], DockerRmSettings] | None=None) -> ExecResult

    Remove containers: docker rm.

  • static async wait(ctx: ServiceContext, configure: Callable[[DockerWaitSettings], DockerWaitSettings] | None=None) -> ExecResult

    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.

  • static async rename(ctx: ServiceContext, configure: Callable[[DockerRenameSettings], DockerRenameSettings] | None=None) -> ExecResult

    Rename a container: docker rename.

  • static async update(ctx: ServiceContext, configure: Callable[[DockerUpdateSettings], DockerUpdateSettings] | None=None) -> ExecResult

    Change a container's resource limits: docker update.

  • static async ps(ctx: ServiceContext, configure: Callable[[DockerPsSettings], DockerPsSettings] | None=None) -> ExecResult

    List containers: docker ps.

  • static async ps_entries(ctx: ServiceContext, configure: Callable[[DockerPsSettings], DockerPsSettings] | None=None) -> object

    The containers as parsed DockerContainerEntry values, from docker ps --format '{{json .}}'.

  • static async logs(ctx: ServiceContext, configure: Callable[[DockerLogsSettings], DockerLogsSettings] | None=None) -> ExecResult

    Read a container's logs: docker logs.

  • static async inspect(ctx: ServiceContext, configure: Callable[[DockerInspectSettings], DockerInspectSettings] | None=None) -> ExecResult

    Describe docker objects: docker inspect.

  • static async top(ctx: ServiceContext, configure: Callable[[DockerTopSettings], DockerTopSettings] | None=None) -> ExecResult

    List a container's processes: docker top.

  • static async stats(ctx: ServiceContext, configure: Callable[[DockerStatsSettings], DockerStatsSettings] | None=None) -> ExecResult

    Sample resource usage once: docker stats --no-stream.

  • static async port(ctx: ServiceContext, configure: Callable[[DockerPortSettings], DockerPortSettings] | None=None) -> ExecResult

    Show a container's port mappings: docker port.

  • static async diff(ctx: ServiceContext, configure: Callable[[DockerDiffSettings], DockerDiffSettings] | None=None) -> ExecResult

    Show a container's filesystem changes: docker diff.

  • static async cp(ctx: ServiceContext, configure: Callable[[DockerCpSettings], DockerCpSettings] | None=None) -> ExecResult

    Copy files between a container and the host: docker cp.

  • static async commit(ctx: ServiceContext, configure: Callable[[DockerCommitSettings], DockerCommitSettings] | None=None) -> ExecResult

    Turn a container into an image: docker commit.

  • static async export(ctx: ServiceContext, configure: Callable[[DockerExportSettings], DockerExportSettings] | None=None) -> ExecResult

    Export a container's filesystem: docker export.

  • static async images(ctx: ServiceContext, configure: Callable[[DockerImagesSettings], DockerImagesSettings] | None=None) -> ExecResult

    List images: docker images.

  • static async image_entries(ctx: ServiceContext, configure: Callable[[DockerImagesSettings], DockerImagesSettings] | None=None) -> object

    The images as parsed DockerImageEntry values, from docker images --format '{{json .}}'.

  • static async pull(ctx: ServiceContext, configure: Callable[[DockerPullSettings], DockerPullSettings] | None=None) -> ExecResult

    Pull an image: docker pull.

  • static async push(ctx: ServiceContext, configure: Callable[[DockerPushSettings], DockerPushSettings] | None=None) -> ExecResult

    Push an image: docker push.

  • static async tag(ctx: ServiceContext, configure: Callable[[DockerTagSettings], DockerTagSettings] | None=None) -> ExecResult

    Tag an image: docker tag.

  • static async rmi(ctx: ServiceContext, configure: Callable[[DockerRmiSettings], DockerRmiSettings] | None=None) -> ExecResult

    Remove images: docker rmi.

  • static async save(ctx: ServiceContext, configure: Callable[[DockerSaveSettings], DockerSaveSettings] | None=None) -> ExecResult

    Save images to a tar archive: docker save.

  • static async load(ctx: ServiceContext, configure: Callable[[DockerLoadSettings], DockerLoadSettings] | None=None) -> ExecResult

    Load images from a tar archive: docker load.

  • static async history(ctx: ServiceContext, configure: Callable[[DockerHistorySettings], DockerHistorySettings] | None=None) -> ExecResult

    Show an image's layers: docker history.

  • static async import_(ctx: ServiceContext, configure: Callable[[DockerImportSettings], DockerImportSettings] | None=None) -> ExecResult

    Create an image from a tarball: docker import.

  • static async image_prune(ctx: ServiceContext, configure: Callable[[DockerImagePruneSettings], DockerImagePruneSettings] | None=None) -> ExecResult

    Remove unused images: docker image prune.

  • static async login(ctx: ServiceContext, configure: Callable[[DockerLoginSettings], DockerLoginSettings] | None=None) -> ExecResult

    Authenticate to a registry: docker login.

  • static async logout(ctx: ServiceContext, configure: Callable[[DockerLogoutSettings], DockerLogoutSettings] | None=None) -> ExecResult

    Forget a registry's credentials: docker logout.

  • static async search(ctx: ServiceContext, configure: Callable[[DockerSearchSettings], DockerSearchSettings] | None=None) -> ExecResult

    Search Docker Hub: docker search.

  • static async info(ctx: ServiceContext, configure: Callable[[DockerInfoSettings], DockerInfoSettings] | None=None) -> ExecResult

    Describe the daemon: docker info.

  • static async version(ctx: ServiceContext, configure: Callable[[DockerVersionSettings], DockerVersionSettings] | None=None) -> ExecResult

    Report client and daemon versions: docker version.

  • static async system(ctx: ServiceContext, configure: Callable[[DockerSystemSettings], DockerSystemSettings] | None=None) -> ExecResult

    Reclaim space or report usage: docker system prune|df|info.

  • static async volume(ctx: ServiceContext, configure: Callable[[DockerVolumeSettings], DockerVolumeSettings] | None=None) -> ExecResult

    Manage volumes: docker volume create|ls|rm|inspect|prune.

  • static async volume_names(ctx: ServiceContext, configure: Callable[[DockerVolumeSettings], DockerVolumeSettings] | None=None) -> object

    The volume names, from docker volume ls --format '{{.Name}}'.

  • static async network(ctx: ServiceContext, configure: Callable[[DockerNetworkSettings], DockerNetworkSettings] | None=None) -> ExecResult

    Manage networks: docker network create|ls|rm|inspect|connect|….

  • static async network_names(ctx: ServiceContext, configure: Callable[[DockerNetworkSettings], DockerNetworkSettings] | None=None) -> object

    The network names, from docker network ls --format '{{.Name}}'.

  • static async context(ctx: ServiceContext, configure: Callable[[DockerContextSettings], DockerContextSettings] | None=None) -> ExecResult

    Manage the daemons to talk to: docker context create|ls|use|….

#

DockerTopSettings

class
class DockerTopSettings(DockerSettings)

Settings for docker top.

  • container(name: str) -> Self

    The container whose processes to list (required).

  • ps_args(*args: str) -> Self

    Arguments passed through to ps inside the container.

#

DockerUnpauseSettings

class
class DockerUnpauseSettings(DockerContainerListSettings)

Settings for docker unpause.

#

DockerUpdateSettings

class
class DockerUpdateSettings(DockerContainerListSettings)

Settings for docker update.

  • memory(limit: str) -> Self

    The memory limit (--memory), e.g. 512m.

  • cpus(count: str) -> Self

    How many CPUs the container may use (--cpus).

  • restart(policy: str) -> Self

    The restart policy (--restart).

#

DockerVersionSettings

class
class DockerVersionSettings(DockerSettings)

Settings for docker version.

  • format(template: str) -> Self

    Render through a Go template (--format), e.g. {{.Server.Version}} to read just the daemon's version.

#

DockerVolumeSettings

class
class DockerVolumeSettings(DockerSettings)

Settings for docker volume. Pick the subcommand with create, ls, remove, inspect, or prune.

  • create(name: str | None=None) -> Self

    Create a volume (volume create [<name>]).

  • ls() -> Self

    List volumes (volume ls), the default.

  • remove(*names: str) -> Self

    Remove volumes (volume rm <name>...).

  • inspect(*names: str) -> Self

    Describe volumes (volume inspect <name>...).

  • prune() -> Self

    Remove the volumes nothing uses (volume prune).

  • driver(name: str) -> Self

    The volume driver (--driver), for a created volume.

  • label(key: str, value: str) -> Self

    Attach metadata (--label); repeatable.

  • opt(key: str, value: str) -> Self

    A driver-specific option (--opt); repeatable.

  • filter(*expressions: str) -> Self

    Filter a listing or a prune (--filter); repeatable.

  • format(template: str) -> Self

    Render each volume through a Go template (--format). "./docker.ts".DockerTasks.volumeNames pins {{.Name}}.

  • quiet_output() -> Self

    Only print volume names (-q/--quiet).

  • force() -> Self

    Do not prompt, and remove even a volume in use where docker allows it (--force).

  • all() -> Self

    Prune anonymous *and* named volumes (--all), not only anonymous ones.

#

DockerWaitSettings

class
class DockerWaitSettings(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.