c8d/prune: Default dangling to true, familiarize untagged images#46911
c8d/prune: Default dangling to true, familiarize untagged images#46911thaJeztah merged 2 commits intomoby:masterfrom
dangling to true, familiarize untagged images#46911Conversation
If no `dangling` filter is specified, prune should only delete dangling images. This wasn't visible by doing `docker image prune` because the CLI explicitly sets this filter to true. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
To align with the graphdriver implementation. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Did this also fail with the graph-driver? (from the above, it sounds like it's an existing bug, is that correct?) |
|
Ah, never mind I see the graph-driver implementation has the default set correctly already; moby/daemon/images/image_prune.go Line 50 in 659e7b5 |
|
@vvoland for a follow-up, should we remove that default from the CLI? (tempted to say that defaults should be either on the CLI or on the daemon, not "both" |
|
Guessing that this is the offending line https://github.com/docker/cli/blob/623d9b1f68171e3ff9899b21392ac4f102ba533b/cli/command/image/prune.go#L63 pruneFilters.Add("dangling", strconv.FormatBool(!options.all))Which means we unconditionally set the |
|
I think that the current CLI behavior is correct - if the |
c8d/prune: Default dangling filter to true
If no
danglingfilter is specified, prune should only delete danglingimages.
This wasn't visible by doing
docker image prunebecause the CLIexplicitly sets this filter to true.
c8d/prune: Familiarize image names that were untagged
To align with the graphdriver implementation.
Signed-off-by: Paweł Gronowski pawel.gronowski@docker.com
- How to verify it
docker-py
tests.integration.api_image_test.PruneImagesTestshould pass now- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)