Docker Prune

Docker Prune

Certified

Prune unused Docker resources

Cleans up unused Docker build cache, containers, images, networks, or volumes via the daemon. Prune type is required; dangling defaults to false.

yaml
type: io.kestra.plugin.docker.cli.Prune

Prune all docker images

yaml
id: docker_prune_images
namespace: company.team

tasks:
  - id: prune_images
    type: io.kestra.plugin.docker.cli.Prune
    pruneType: IMAGES
    dangling: true
Properties
Possible Values
BUILDCONTAINERSIMAGESNETWORKSVOLUMES

Prune type

One of BUILD, CONTAINERS, IMAGES, NETWORKS, or VOLUMES to target specific resources.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Docker configuration file

Docker configuration file that can set access credentials to private container registries. Usually located in ~/.docker/config.json.

Credentials for a private container registry

Definitions
authstring

The registry authentication.

The auth field is a base64-encoded authentication string of username: password or a token.

identityTokenstring

The identity token.

passwordstring

The registry password.

registrystring

The registry URL.

If not defined, the registry will be extracted from the image name.

registryTokenstring

The registry token.

usernamestring

The registry username.

Defaultfalse

Dangling only

For IMAGES prune type: true prunes only unused untagged images; false prunes all unused images.

Docker host or URI

The Docker daemon to connect to, e.g. tcp://localhost: 2375 or a Unix socket path. Defaults to the daemon available to the task runner.

SubTypestring

Label filters

Optional labels used to filter the resources being pruned; applies to whichever pruneType is selected.

Until filter

For CONTAINERS, IMAGES, and NETWORKS: prune items created before this timestamp or duration (e.g., 10m, 1h30m) using daemon time.