@zuke/docker

← API reference

`@zuke/docker` — typed `docker` CLI task wrappers for Zuke builds.

Symbols

# DockerBuildSettings class
class DockerBuildSettings extends DockerSettings

Settings for docker build.

MemberSignatureDoc
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 .).
# DockerExecSettings class
class DockerExecSettings extends DockerSettings

Settings for docker exec.

MemberSignatureDoc
container container(name: string): this The target container (required).
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 for the command (-e KEY=value).
workdir workdir(path: PathLike): this Working directory inside the container (-w).
commandArgs commandArgs(...args: Array<string | number>): this The command and arguments to execute.
# DockerImagesSettings class
class DockerImagesSettings extends DockerSettings

Settings for docker images.

MemberSignatureDoc
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).
# DockerLoadSettings class
class DockerLoadSettings extends DockerSettings

Settings for docker load.

MemberSignatureDoc
input input(path: PathLike): this Read from a tar archive instead of STDIN (-i).
quietOutput quietOutput(): this Suppress the load output (-q).
# DockerLoginSettings class
class DockerLoginSettings extends DockerSettings

Settings for docker login.

MemberSignatureDoc
username username(value: string): this The username (-u).
password password(value: string): this The password (-p). This lands directly in the process argv, where it can leak through ps/process listings, shell history, or CI job logs — passwordStdin is the safe choice in CI (and generally), since it pipes the secret through STDIN instead of putting it on the command line.
passwordStdin passwordStdin(): this Read the password from STDIN (--password-stdin).
registry registry(server: string): this The registry server (defaults to Docker Hub).
# DockerPsSettings class
class DockerPsSettings extends DockerSettings

Settings for docker ps.

MemberSignatureDoc
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.
# DockerPullSettings class
class DockerPullSettings extends DockerSettings

Settings for docker pull.

MemberSignatureDoc
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).
# DockerPushSettings class
class DockerPushSettings extends DockerSettings

Settings for docker push.

MemberSignatureDoc
image image(reference: string): this The image reference to push (required).
allTags allTags(): this Push every tag of the repository (--all-tags).
# DockerRmiSettings class
class DockerRmiSettings extends DockerSettings

Settings for docker rmi.

MemberSignatureDoc
images images(...references: string[]): this The images to remove (at least one is required).
force force(): this Force removal (-f).
# DockerRmSettings class
class DockerRmSettings extends DockerSettings

Settings for docker rm.

MemberSignatureDoc
containers containers(...names: string[]): this The containers to remove (at least one is required).
force force(): this Force removal of a running container (-f).
volumes volumes(): this Also remove anonymous volumes (-v).
# DockerRunSettings class
class DockerRunSettings extends DockerSettings

Settings for docker run.

MemberSignatureDoc
image image(reference: string): this The image to run (required).
name name(value: string): this Assign a container name (--name).
rm rm(): this Remove the container when it exits (--rm).
detach detach(): this Run the container in the background (-d).
interactive interactive(): this Keep STDIN open (-i).
tty tty(): this Allocate a pseudo-TTY (-t).
envVar envVar(key: string, value: string): this Set a container environment variable (-e KEY=value); repeatable.
publish publish(host: string | number, container: string | number): this Publish a container port to the host (-p host:container).
volume volume(source: PathLike, target: PathLike): this Bind-mount or attach a volume (-v source:target).
network network(value: string): this Connect the container to a network (--network).
commandArgs commandArgs(...args: Array<string | number>): this The command and arguments to run inside the container.
# DockerSaveSettings class
class DockerSaveSettings extends DockerSettings

Settings for docker save.

MemberSignatureDoc
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).
# DockerSettings class
class DockerSettings extends ToolSettings

Base for all docker subcommand settings: the binary is docker.

# DockerStartSettings class
class DockerStartSettings extends DockerSettings

Settings for docker start.

MemberSignatureDoc
containers containers(...names: string[]): this The containers to start (at least one is required).
attach attach(): this Attach STDOUT/STDERR and forward signals (-a).
# DockerStopSettings class
class DockerStopSettings extends DockerSettings

Settings for docker stop.

MemberSignatureDoc
containers containers(...names: string[]): this The containers to stop (at least one is required).
time time(seconds: number): this Seconds to wait before killing (-t).
# DockerTagSettings class
class DockerTagSettings extends DockerSettings

Settings for docker tag.

MemberSignatureDoc
source source(reference: string): this The existing image reference (required).
target target(reference: string): this The new image reference (required).
# DockerTasks const
const DockerTasks: DockerTasksApi

Typed task functions for the docker CLI.

# DockerTasksApi interface
interface DockerTasksApi

The shape of DockerTasks.

MemberSignatureDoc
build build(configure?: Configure<DockerBuildSettings>): Promise<CommandOutput> Build an image: docker build.
run run(configure?: Configure<DockerRunSettings>): Promise<CommandOutput> Run a container: docker run.
exec exec(configure?: Configure<DockerExecSettings>): Promise<CommandOutput> Run a command in a container: docker exec.
push push(configure?: Configure<DockerPushSettings>): Promise<CommandOutput> Push an image: docker push.
pull pull(configure?: Configure<DockerPullSettings>): Promise<CommandOutput> Pull an image: docker pull.
tag tag(configure?: Configure<DockerTagSettings>): Promise<CommandOutput> Tag an image: docker tag.
login login(configure?: Configure<DockerLoginSettings>): Promise<CommandOutput> Authenticate to a registry: docker login.
images images(configure?: Configure<DockerImagesSettings>): Promise<CommandOutput> List images: docker images.
ps ps(configure?: Configure<DockerPsSettings>): Promise<CommandOutput> List containers: docker ps.
stop stop(configure?: Configure<DockerStopSettings>): Promise<CommandOutput> Stop containers: docker stop.
start start(configure?: Configure<DockerStartSettings>): Promise<CommandOutput> Start containers: docker start.
rm rm(configure?: Configure<DockerRmSettings>): Promise<CommandOutput> Remove containers: docker rm.
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.