Skip to content

[Feature request] Dry run mode for prune commands #30623

@albers

Description

@albers

The new prune commands are potentially dangerous and I find it hard to predict what actually would be deleted. The user might use docker system df and docker image ls --filter dangling=true to get to this information, but this seems like an unneccessary step.

I propose to add a new operating mode where the normal output is produced without actually deleting the objects.

$ docker system prune --dry-run
Warning: Running in dry run mode, not actually deleting anything.
Deleted Volumes:
dockerdev-go-pkg-cache-gopath
dockerdev-go-pkg-cache-goroot-linux_amd64_netgo

Total reclaimed space: 112.1 MB

The user could then decide to run the same command again without --dry-run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientexp/beginnerkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions