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.

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.

The URI of your Docker host e.g. localhost

SubTypestring

Label filters

Optional labels to filter containers before pruning.

Reference (ref) of the pluginDefaults to apply to this task.

Until filter

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