-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I use Prune so that it gets all of the images? #1939
Comments
Running into the same issue, there are actually prunes for everything:
Note that you're just calling it on images. |
There also seems to be a discrepancy between using the Python API and the Docker command line for me. |
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. [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> client = docker.from_env()
>>> client.images.list()
[<Image: 'docker.io/nginx:1.12.2'>, <Image: 'docker.io/nginx:latest'>, <Image: 'docker.io/alpine:latest'>]
>>> client.images.prune()
{u'SpaceReclaimed': 0, u'ImagesDeleted': None} [root@localhost ~]# docker image prune -a -f |
I get the same behavior as @rodrigodlima has with server api version 1.37 |
The In short, |
yes that worked! Thanks. Do we have 'until' filter available? |
Ahh yes 'until' filter also works. But its not mentioned in the docs |
How to sort docker containers as it's do the command ? |
I built an image and then afterward ran
client.images.prune()
. The returned dict stated{'ImagesDeleted': None, 'SpaceReclaimed': 0}
. I then randocker 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?
The text was updated successfully, but these errors were encountered: