How do I use Prune so that it gets all of the images?
See original GitHub issueI built an image and then afterward ran client.images.prune()
. The returned dict stated {'ImagesDeleted': None, 'SpaceReclaimed': 0}
. I then ran docker system prune -a -f
and saw that it deleted a lot of space (~1gb). I then tried client.images.remove, but that also did nothing.
What’s the correct way of pruning the system from docker-py?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
docker image prune - Docker Documentation
docker image prune -a WARNING! This will remove all images without at least one container associated to them. Are you sure you want...
Read more >How To Remove All Stopped Containers And Unused Images ...
In this video, I will explain the prune command which will help to remove containers and images.docker container prunedocker system prune ...
Read more >Docker prune explained - usage and examples
Docker prune is the way to clean up containers, images, volumes and networks on your system. See how to remove unused resources, ...
Read more >How to Prune Docker Images Automatically with a Daily Cron ...
Docker has a fantastic 'prune' command to tell it to cleanup all unused docker containers but unfortunately this is not something that it...
Read more >How To Remove Docker Images, Containers, and Volumes
Note: The command substitution syntax, command $( command ) , used in the commands is available in many popular shells, such as bash,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
-a
option in the CLI is equivalent to setting thedangling
filter tofalse
. (according to https://github.com/docker/cli/blob/master/cli/command/image/prune.go#L59)In short,
docker image prune -a -f
translates as such:client.images.prune(filters={'dangling': False})
For me, the client.images.prune() don’t works too. For example, I have one image nginx:1.12.2 that is not in use for any container, when I run the client.images.prune(), this image is not removed.
[root@localhost ~]# docker image prune -a -f Deleted Images: untagged: docker.io/nginx:1.12.2