zuke.tools.docker
@zuke/docker 1.1.1: @zuke/docker — typed DockerTasks wrappers for the docker CLI.
zuke on PyPI ↗ 48 symbols
Symbols
class DockerBuildSettings(DockerSettings) Settings for docker build.
-
tag(reference: str) -> SelfAdd an image tag (
-t); repeatable. -
file(path: str) -> SelfUse an explicit Dockerfile (
-f). -
target(stage: str) -> SelfBuild a specific stage (
--target). -
platform(value: str) -> SelfSet the target platform(s) (
--platform). -
build_arg(key: str, value: str) -> SelfPass a build-time variable (
--build-arg KEY=value); repeatable. -
no_cache() -> SelfDo not use the layer cache (
--no-cache). -
pull() -> SelfAlways attempt to pull newer base images (
--pull). -
push() -> SelfPush the result to the registry after building (
--push). -
context(path: str) -> SelfThe build context path or URL (default
.).
class DockerCommitSettings(DockerSettings) Settings for docker commit.
-
container(name: str) -> SelfThe container to snapshot (required).
-
reference(name: str) -> SelfThe image name to give the snapshot (positional).
-
message(text: str) -> SelfA commit message (
-m/--message). -
author(value: str) -> SelfThe author to record (
-a/--author). -
change(*instructions: str) -> SelfApply a Dockerfile instruction to the result (
-c/--change); repeatable. -
no_pause() -> SelfLeave the container running while it is committed (
--pause=false). docker pauses it by default, which is what makes the snapshot consistent.
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) -> SelfContainer names or ids to act on (required); repeatable.
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) -> SelfThe image to run (required).
-
name(value: str) -> SelfName the container (
--name). -
rm() -> SelfRemove the container when it exits (
--rm). -
detach() -> SelfRun in the background (
-d). -
publish(host: str | float, container: str | float) -> SelfPublish a container port to the host (
-p); repeatable. -
volume(source: str, target: str) -> SelfMount a host path into the container (
-v); repeatable. -
network(value: str) -> SelfAttach the container to a network (
--network). -
entrypoint(command: str) -> SelfOverride the image's entrypoint (
--entrypoint). -
platform(value: str) -> SelfRun the image for a specific platform (
--platform). -
pull(policy: Literal['always', 'missing', 'never']) -> SelfWhen to pull the image (
--pull=<always|missing|never>). -
restart(policy: str) -> SelfThe restart policy (
--restart), e.g.unless-stopped. -
label(key: str, value: str) -> SelfAttach metadata to the container (
--label); repeatable.
class DockerContextSettings(DockerSettings) Settings for docker context. Pick the subcommand with create, ls, use, inspect, remove, or show.
-
create(name: str) -> SelfCreate a context (
context create <name>). -
ls() -> SelfList contexts (
context ls), the default. -
use(name: str) -> SelfMake a context the default for later commands (
context use <name>). -
inspect(*names: str) -> SelfDescribe contexts (
context inspect [<name>...]). -
remove(*names: str) -> SelfRemove contexts (
context rm <name>...). -
show() -> SelfPrint the context in use (
context show). -
docker_host(address: str) -> SelfThe daemon a created context points at (
--docker host=<address>). -
description(text: str) -> SelfA human description for a created context (
--description). -
from_(name: str) -> SelfCopy an existing context (
--from <name>). -
format(template: str) -> SelfRender each context through a Go template (
--format). -
quiet_output() -> SelfOnly print context names (
-q/--quiet). -
force() -> SelfRemove even the context in use (
-f/--force).
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) -> SelfThe source,
<container>:<path>or a host path (required). -
to(path: str) -> SelfThe destination,
<container>:<path>or a host path (required). -
archive() -> SelfKeep uid/gid rather than mapping to the current user (
-a/--archive). -
follow_link() -> SelfFollow a symlink in the source (
-L/--follow-link).
class DockerCreateSettings(DockerContainerSettings) Settings for docker create.
class DockerDiffSettings(DockerSettings) Settings for docker diff.
-
container(name: str) -> SelfThe container whose filesystem changes to show (required).
class DockerExecSettings(DockerProcessSettings) Settings for docker exec.
-
container(name: str) -> SelfThe container to run the command in (required).
-
detach() -> SelfRun the command in the background (
-d). -
privileged() -> SelfGive the command extended privileges (
--privileged).
class DockerExportSettings(DockerSettings) Settings for docker export.
-
container(name: str) -> SelfThe container whose filesystem to export (required).
-
output(path: str) -> SelfWrite to a file rather than stdout (
-o/--output).
class DockerHistorySettings(DockerSettings) Settings for docker history.
-
image(reference: str) -> SelfThe image whose layers to show (required).
-
no_trunc() -> SelfPrint the full commands rather than eliding them (
--no-trunc). -
quiet_output() -> SelfOnly show layer ids (
-q/--quiet). -
format(template: str) -> SelfRender each layer through a Go template (
--format).
class DockerImagePruneSettings(DockerSettings) Settings for docker image prune.
-
all() -> SelfRemove every unused image, not only the dangling ones (
--all). This is the difference between reclaiming a little space and reclaiming a lot. -
force() -> SelfDo not prompt for confirmation (
--force), which a build always needs. -
filter(*expressions: str) -> SelfLimit what is pruned (
--filter), e.g.until=24h; repeatable.
class DockerImagesSettings(DockerSettings) Settings for docker images.
-
all() -> SelfShow all images, including intermediate layers (
-a). -
quiet_output() -> SelfOnly show image IDs (
-q). -
filter(expression: str) -> SelfFilter the listing (
--filter); repeatable. -
repository(name: str) -> SelfRestrict to a repository (positional argument).
-
format(template: str) -> SelfRender each image through a Go template (
--format), e.g.{{json .}}for one JSON object per line. "./docker.ts".DockerTasks.imageEntries pins that form. -
digests() -> SelfAlso show each image's digest (
--digests).
class DockerImportSettings(DockerSettings) Settings for docker import.
-
source(path: str) -> SelfThe tarball to import (required);
-reads it from stdin, as docker's ownimportdoes. -
reference(name: str) -> SelfThe image name to give the result (positional).
-
message(text: str) -> SelfA commit message for the imported image (
-m/--message). -
change(*instructions: str) -> SelfApply a Dockerfile instruction to the result (
-c/--change); repeatable. -
platform(value: str) -> SelfThe platform to import for (
--platform).
class DockerInfoSettings(DockerSettings) Settings for docker info.
-
format(template: str) -> SelfRender through a Go template (
--format), e.g.{{json .}}.
class DockerInspectSettings(DockerSettings) Settings for docker inspect.
-
targets(*names: str) -> SelfThe objects to inspect — containers, images, volumes (required).
-
format(template: str) -> SelfRender through a Go template (
--format), e.g.{{.State.Status}}for one field, or{{json .}}for the whole record as JSON. -
type_(kind: str) -> SelfOnly look for this kind of object (
--type), e.g.container. -
size() -> SelfInclude the disk usage of a container (
-s/--size).
class DockerKillSettings(DockerContainerListSettings) Settings for docker kill.
-
signal(name: str) -> SelfThe signal to send (
-s/--signal); docker defaults toSIGKILL.
class DockerLoadSettings(DockerSettings) Settings for docker load.
-
input(path: str) -> SelfRead from a tar archive instead of STDIN (
-i). -
quiet_output() -> SelfSuppress the load output (
-q).
class DockerLoginSettings(DockerSettings) Settings for docker login.
-
username(value: str) -> SelfThe username (
-u). -
password(value: str) -> SelfThe 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 — throughpsor/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-pfor the same reason. Masking is what can be done here, not a fix for the exposure. -
password_stdin(token: str) -> SelfPipe 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-stdinwith no writer leaves docker reading a stream that is never written. -
registry(server: str) -> SelfThe registry server (defaults to Docker Hub).
class DockerLogoutSettings(DockerSettings) Settings for docker logout.
-
registry(server: str) -> SelfThe registry to forget (positional); defaults to Docker Hub.
class DockerLogsSettings(DockerSettings) Settings for docker logs.
-
container(name: str) -> SelfThe container whose logs to read (required).
-
follow() -> SelfKeep 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) -> SelfShow only the last N lines (
--tail), orall. -
since(when: str) -> SelfOnly logs since this timestamp or relative time (
--since), e.g.10m. -
until(when: str) -> SelfOnly logs before this timestamp or relative time (
--until). -
timestamps() -> SelfPrefix each line with its timestamp (
-t/--timestamps). -
details() -> SelfInclude the extra attributes docker records (
--details).
class DockerNetworkSettings(DockerSettings) Settings for docker network. Pick the subcommand with create, ls, remove, inspect, connect, disconnect, or prune.
-
create(name: str) -> SelfCreate a network (
network create <name>). -
ls() -> SelfList networks (
network ls), the default. -
remove(*names: str) -> SelfRemove networks (
network rm <name>...). -
inspect(*names: str) -> SelfDescribe networks (
network inspect <name>...). -
connect(network: str, container: str) -> SelfAttach a container to a network (
network connect <net> <container>). -
disconnect(network: str, container: str) -> SelfDetach a container (
network disconnect <net> <container>). -
prune() -> SelfRemove the networks nothing uses (
network prune). -
driver(name: str) -> SelfThe network driver (
--driver), e.g.bridge. -
subnet(cidr: str) -> SelfThe subnet in CIDR form (
--subnet). -
gateway(address: str) -> SelfThe gateway address (
--gateway). -
label(key: str, value: str) -> SelfAttach metadata (
--label); repeatable. -
alias(name: str) -> SelfAn extra name the container answers to on this network (
--alias). -
filter(*expressions: str) -> SelfFilter a listing or a prune (
--filter); repeatable. -
format(template: str) -> SelfRender each network through a Go template (
--format). "./docker.ts".DockerTasks.networkNames pins{{.Name}}. -
quiet_output() -> SelfOnly print network ids (
-q/--quiet). -
force() -> SelfDo not prompt for confirmation (
--force).
class DockerPauseSettings(DockerContainerListSettings) Settings for docker pause.
class DockerPortSettings(DockerSettings) Settings for docker port.
-
container(name: str) -> SelfThe container whose port mappings to show (required).
-
port(value: str | float) -> SelfA single private port to resolve, e.g.
8080/tcp.
class DockerProcessSettings(DockerSettings) Base for the commands that run a process — run, create, and exec — carrying the flags all three accept.
-
interactive() -> SelfKeep stdin open (
-i). -
tty() -> SelfAllocate a pseudo-TTY (
-t). -
env_var(key: str, value: str) -> SelfSet an environment variable (
-e); repeatable. -
env_file(*paths: str) -> SelfRead environment variables from a file (
--env-file); repeatable. -
workdir(path: str) -> SelfSet the working directory inside the container (
-w). -
user(value: str) -> SelfRun as this user or
uid:gid(-u/--user). -
command_args(*args: str | float) -> SelfThe command and arguments to run inside the container.
class DockerPsSettings(DockerSettings) Settings for docker ps.
-
all() -> SelfShow stopped containers too (
-a). -
quiet_output() -> SelfOnly show container IDs (
-q). -
filter(expression: str) -> SelfFilter the listing (
--filter); repeatable. -
format(template: str) -> SelfRender each container through a Go template (
--format), e.g.{{json .}}for one JSON object per line. "./docker.ts".DockerTasks.psEntries pins that form. -
latest() -> SelfShow only the most recently created container (
-l/--latest). -
no_trunc() -> SelfPrint ids and commands in full (
--no-trunc). -
size() -> SelfInclude each container's disk usage (
-s/--size).
class DockerPullSettings(DockerSettings) Settings for docker pull.
-
image(reference: str) -> SelfThe image reference to pull (required).
-
platform(value: str) -> SelfPull a specific platform (
--platform). -
quiet_output() -> SelfSuppress verbose output (
-q).
class DockerPushSettings(DockerSettings) Settings for docker push.
-
image(reference: str) -> SelfThe image reference to push (required).
-
all_tags() -> SelfPush every tag of the repository (
--all-tags).
class DockerRenameSettings(DockerSettings) Settings for docker rename.
-
container(name: str) -> SelfThe container to rename (required).
-
new_name(name: str) -> SelfIts new name (required).
class DockerRestartSettings(DockerContainerListSettings) Settings for docker restart.
-
timeout(seconds: float) -> SelfSeconds to wait before killing the container (
-t/--time). -
signal(name: str) -> SelfThe signal to send first (
-s/--signal).
class DockerRmiSettings(DockerSettings) Settings for docker rmi.
-
images(*references: str) -> SelfThe images to remove (at least one is required).
-
force() -> SelfForce removal (
-f).
class DockerRmSettings(DockerContainerListSettings) Settings for docker rm.
-
force() -> SelfForce removal of a running container (
-f). -
volumes() -> SelfAlso remove anonymous volumes (
-v).
class DockerRunSettings(DockerContainerSettings) Settings for docker run.
class DockerSaveSettings(DockerSettings) Settings for docker save.
-
images(*references: str) -> SelfThe images to save (at least one is required).
-
output(path: str) -> SelfWrite to a file instead of STDOUT (
-o).
class DockerSearchSettings(DockerSettings) Settings for docker search.
-
term(value: str) -> SelfWhat to search Docker Hub for (required).
-
limit(count: float) -> SelfCap the number of results (
--limit). -
filter(*expressions: str) -> SelfFilter the results (
--filter), e.g.is-official=true; repeatable. -
format(template: str) -> SelfRender each result through a Go template (
--format). -
no_trunc() -> SelfPrint descriptions in full (
--no-trunc).
class DockerSettings(ToolSettings) Shared base for every docker subcommand: the binary and global options.
-
docker_context(name: str) -> SelfUse a named docker context (
--context), which is how a build talks to a remote daemon or a second local one without exportingDOCKER_HOST. NameddockerContextrather thancontextbecausedocker build's trailingPATHis *also* called a context, and "./build.ts".DockerBuildSettings.context already means that one. -
host(address: str) -> SelfThe daemon socket to connect to (
--host), e.g.ssh://build@host. -
log_level(level: Literal['debug', 'info', 'warn', 'error', 'fatal']) -> SelfHow much the client logs (
--log-level). -
config(path: str) -> SelfWhere the client config lives (
--config). -
debug() -> SelfEnable client debug output (
--debug).
class DockerStartSettings(DockerContainerListSettings) Settings for docker start.
-
attach() -> SelfAttach STDOUT/STDERR and forward signals (
-a).
class DockerStatsSettings(DockerSettings) Settings for docker stats.
-
containers(*names: str) -> SelfLimit the report to these containers; omit for all running ones.
-
all() -> SelfInclude stopped containers (
-a/--all). -
format(template: str) -> SelfRender through a Go template (
--format).
class DockerStopSettings(DockerContainerListSettings) Settings for docker stop.
-
time(seconds: float) -> SelfSeconds to wait before killing (
-t).
class DockerSystemSettings(DockerSettings) Settings for docker system. Pick the subcommand with prune, df, or info.
-
prune() -> SelfReclaim space (
system prune). -
df() -> SelfReport what is using disk (
system df). -
info() -> SelfDescribe the daemon (
system info). -
all() -> SelfPrune every unused image, not only the dangling ones (
--all) — the difference between reclaiming a little space and reclaiming a lot. -
force() -> SelfDo not prompt for confirmation (
--force), which a build always needs. -
volumes() -> SelfAlso remove unused volumes (
--volumes), which a prune otherwise keeps. -
filter(*expressions: str) -> SelfLimit what is pruned (
--filter), e.g.until=24h; repeatable. -
verbose() -> SelfBreak the
dfreport down per object (-v/--verbose). -
format(template: str) -> SelfRender through a Go template (
--format).
class DockerTagSettings(DockerSettings) Settings for docker tag.
-
source(reference: str) -> SelfThe existing image reference (required).
-
target(reference: str) -> SelfThe new image reference (required).
class DockerTasks Typed task functions for the docker CLI.
-
static async build(ctx: ServiceContext, configure: Callable[[DockerBuildSettings], DockerBuildSettings] | None=None) -> ExecResultBuild an image:
docker build. -
static async run(ctx: ServiceContext, configure: Callable[[DockerRunSettings], DockerRunSettings] | None=None) -> ExecResultRun a container:
docker run. -
static async create(ctx: ServiceContext, configure: Callable[[DockerCreateSettings], DockerCreateSettings] | None=None) -> ExecResultCreate a container without starting it:
docker create. -
static async exec(ctx: ServiceContext, configure: Callable[[DockerExecSettings], DockerExecSettings] | None=None) -> ExecResultRun a command in a container:
docker exec. -
static async start(ctx: ServiceContext, configure: Callable[[DockerStartSettings], DockerStartSettings] | None=None) -> ExecResultStart containers:
docker start. -
static async stop(ctx: ServiceContext, configure: Callable[[DockerStopSettings], DockerStopSettings] | None=None) -> ExecResultStop containers:
docker stop. -
static async restart(ctx: ServiceContext, configure: Callable[[DockerRestartSettings], DockerRestartSettings] | None=None) -> ExecResultRestart containers:
docker restart. -
static async kill(ctx: ServiceContext, configure: Callable[[DockerKillSettings], DockerKillSettings] | None=None) -> ExecResultSignal containers:
docker kill. -
static async pause(ctx: ServiceContext, configure: Callable[[DockerPauseSettings], DockerPauseSettings] | None=None) -> ExecResultSuspend a container's processes:
docker pause. -
static async unpause(ctx: ServiceContext, configure: Callable[[DockerUnpauseSettings], DockerUnpauseSettings] | None=None) -> ExecResultResume them:
docker unpause. -
static async rm(ctx: ServiceContext, configure: Callable[[DockerRmSettings], DockerRmSettings] | None=None) -> ExecResultRemove containers:
docker rm. -
static async wait(ctx: ServiceContext, configure: Callable[[DockerWaitSettings], DockerWaitSettings] | None=None) -> ExecResultBlock 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) -> ExecResultRename a container:
docker rename. -
static async update(ctx: ServiceContext, configure: Callable[[DockerUpdateSettings], DockerUpdateSettings] | None=None) -> ExecResultChange a container's resource limits:
docker update. -
static async ps(ctx: ServiceContext, configure: Callable[[DockerPsSettings], DockerPsSettings] | None=None) -> ExecResultList containers:
docker ps. -
static async ps_entries(ctx: ServiceContext, configure: Callable[[DockerPsSettings], DockerPsSettings] | None=None) -> objectThe containers as parsed DockerContainerEntry values, from
docker ps --format '{{json .}}'. -
static async logs(ctx: ServiceContext, configure: Callable[[DockerLogsSettings], DockerLogsSettings] | None=None) -> ExecResultRead a container's logs:
docker logs. -
static async inspect(ctx: ServiceContext, configure: Callable[[DockerInspectSettings], DockerInspectSettings] | None=None) -> ExecResultDescribe docker objects:
docker inspect. -
static async top(ctx: ServiceContext, configure: Callable[[DockerTopSettings], DockerTopSettings] | None=None) -> ExecResultList a container's processes:
docker top. -
static async stats(ctx: ServiceContext, configure: Callable[[DockerStatsSettings], DockerStatsSettings] | None=None) -> ExecResultSample resource usage once:
docker stats --no-stream. -
static async port(ctx: ServiceContext, configure: Callable[[DockerPortSettings], DockerPortSettings] | None=None) -> ExecResultShow a container's port mappings:
docker port. -
static async diff(ctx: ServiceContext, configure: Callable[[DockerDiffSettings], DockerDiffSettings] | None=None) -> ExecResultShow a container's filesystem changes:
docker diff. -
static async cp(ctx: ServiceContext, configure: Callable[[DockerCpSettings], DockerCpSettings] | None=None) -> ExecResultCopy files between a container and the host:
docker cp. -
static async commit(ctx: ServiceContext, configure: Callable[[DockerCommitSettings], DockerCommitSettings] | None=None) -> ExecResultTurn a container into an image:
docker commit. -
static async export(ctx: ServiceContext, configure: Callable[[DockerExportSettings], DockerExportSettings] | None=None) -> ExecResultExport a container's filesystem:
docker export. -
static async images(ctx: ServiceContext, configure: Callable[[DockerImagesSettings], DockerImagesSettings] | None=None) -> ExecResultList images:
docker images. -
static async image_entries(ctx: ServiceContext, configure: Callable[[DockerImagesSettings], DockerImagesSettings] | None=None) -> objectThe images as parsed DockerImageEntry values, from
docker images --format '{{json .}}'. -
static async pull(ctx: ServiceContext, configure: Callable[[DockerPullSettings], DockerPullSettings] | None=None) -> ExecResultPull an image:
docker pull. -
static async push(ctx: ServiceContext, configure: Callable[[DockerPushSettings], DockerPushSettings] | None=None) -> ExecResultPush an image:
docker push. -
static async tag(ctx: ServiceContext, configure: Callable[[DockerTagSettings], DockerTagSettings] | None=None) -> ExecResultTag an image:
docker tag. -
static async rmi(ctx: ServiceContext, configure: Callable[[DockerRmiSettings], DockerRmiSettings] | None=None) -> ExecResultRemove images:
docker rmi. -
static async save(ctx: ServiceContext, configure: Callable[[DockerSaveSettings], DockerSaveSettings] | None=None) -> ExecResultSave images to a tar archive:
docker save. -
static async load(ctx: ServiceContext, configure: Callable[[DockerLoadSettings], DockerLoadSettings] | None=None) -> ExecResultLoad images from a tar archive:
docker load. -
static async history(ctx: ServiceContext, configure: Callable[[DockerHistorySettings], DockerHistorySettings] | None=None) -> ExecResultShow an image's layers:
docker history. -
static async import_(ctx: ServiceContext, configure: Callable[[DockerImportSettings], DockerImportSettings] | None=None) -> ExecResultCreate an image from a tarball:
docker import. -
static async image_prune(ctx: ServiceContext, configure: Callable[[DockerImagePruneSettings], DockerImagePruneSettings] | None=None) -> ExecResultRemove unused images:
docker image prune. -
static async login(ctx: ServiceContext, configure: Callable[[DockerLoginSettings], DockerLoginSettings] | None=None) -> ExecResultAuthenticate to a registry:
docker login. -
static async logout(ctx: ServiceContext, configure: Callable[[DockerLogoutSettings], DockerLogoutSettings] | None=None) -> ExecResultForget a registry's credentials:
docker logout. -
static async search(ctx: ServiceContext, configure: Callable[[DockerSearchSettings], DockerSearchSettings] | None=None) -> ExecResultSearch Docker Hub:
docker search. -
static async info(ctx: ServiceContext, configure: Callable[[DockerInfoSettings], DockerInfoSettings] | None=None) -> ExecResultDescribe the daemon:
docker info. -
static async version(ctx: ServiceContext, configure: Callable[[DockerVersionSettings], DockerVersionSettings] | None=None) -> ExecResultReport client and daemon versions:
docker version. -
static async system(ctx: ServiceContext, configure: Callable[[DockerSystemSettings], DockerSystemSettings] | None=None) -> ExecResultReclaim space or report usage:
docker system prune|df|info. -
static async volume(ctx: ServiceContext, configure: Callable[[DockerVolumeSettings], DockerVolumeSettings] | None=None) -> ExecResultManage volumes:
docker volume create|ls|rm|inspect|prune. -
static async volume_names(ctx: ServiceContext, configure: Callable[[DockerVolumeSettings], DockerVolumeSettings] | None=None) -> objectThe volume names, from
docker volume ls --format '{{.Name}}'. -
static async network(ctx: ServiceContext, configure: Callable[[DockerNetworkSettings], DockerNetworkSettings] | None=None) -> ExecResultManage networks:
docker network create|ls|rm|inspect|connect|…. -
static async network_names(ctx: ServiceContext, configure: Callable[[DockerNetworkSettings], DockerNetworkSettings] | None=None) -> objectThe network names, from
docker network ls --format '{{.Name}}'. -
static async context(ctx: ServiceContext, configure: Callable[[DockerContextSettings], DockerContextSettings] | None=None) -> ExecResultManage the daemons to talk to:
docker context create|ls|use|….
class DockerTopSettings(DockerSettings) Settings for docker top.
-
container(name: str) -> SelfThe container whose processes to list (required).
-
ps_args(*args: str) -> SelfArguments passed through to
psinside the container.
class DockerUnpauseSettings(DockerContainerListSettings) Settings for docker unpause.
class DockerUpdateSettings(DockerContainerListSettings) Settings for docker update.
-
memory(limit: str) -> SelfThe memory limit (
--memory), e.g.512m. -
cpus(count: str) -> SelfHow many CPUs the container may use (
--cpus). -
restart(policy: str) -> SelfThe restart policy (
--restart).
class DockerVersionSettings(DockerSettings) Settings for docker version.
-
format(template: str) -> SelfRender through a Go template (
--format), e.g.{{.Server.Version}}to read just the daemon's version.
class DockerVolumeSettings(DockerSettings) Settings for docker volume. Pick the subcommand with create, ls, remove, inspect, or prune.
-
create(name: str | None=None) -> SelfCreate a volume (
volume create [<name>]). -
ls() -> SelfList volumes (
volume ls), the default. -
remove(*names: str) -> SelfRemove volumes (
volume rm <name>...). -
inspect(*names: str) -> SelfDescribe volumes (
volume inspect <name>...). -
prune() -> SelfRemove the volumes nothing uses (
volume prune). -
driver(name: str) -> SelfThe volume driver (
--driver), for a created volume. -
label(key: str, value: str) -> SelfAttach metadata (
--label); repeatable. -
opt(key: str, value: str) -> SelfA driver-specific option (
--opt); repeatable. -
filter(*expressions: str) -> SelfFilter a listing or a prune (
--filter); repeatable. -
format(template: str) -> SelfRender each volume through a Go template (
--format). "./docker.ts".DockerTasks.volumeNames pins{{.Name}}. -
quiet_output() -> SelfOnly print volume names (
-q/--quiet). -
force() -> SelfDo not prompt, and remove even a volume in use where docker allows it (
--force). -
all() -> SelfPrune anonymous *and* named volumes (
--all), not only anonymous ones.
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.