Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use docker images filter

Tags:

docker

I can write

docker images --filter "dangling=true" 

What other filters can I use?

I can use something like this?

docker images --filter "running=false" 
like image 625
Montells Avatar asked Jul 09 '14 16:07

Montells


People also ask

How can I see the images in my docker repository?

Go to the Repositories view and click on a repository to see its tags. Image sizes are the cumulative space taken up by the image and all its parent images. This is also the disk space used by the contents of the . tar file created when you docker save an image.

How do you clean unused docker images?

If we do not want to find dangling images and remove them one by one, we can use the docker image prune command. This command removes all dangling images. If we also want to remove unused images, we can use the -a flag. The command will return the list of image IDs that were removed and the space that was freed.

What can I do with a docker image?

When the image is deployed to a Docker environment, it can be executed as a Docker container. The docker run command creates a container from a specific image. Docker images are a reusable asset -- deployable on any host. Developers can take the static image layers from one project and use them in another.


1 Answers

Docker v1.13.0 supports the following conditions:

  -f, --filter value    Filter output based on conditions provided (default [])                         - dangling=(true|false)                         - label=<key> or label=<key>=<value>                         - before=(<image-name>[:tag]|<image-id>|<image@digest>)                         - since=(<image-name>[:tag]|<image-id>|<image@digest>)                         - reference=(pattern of an image reference) 

Or use grep to filter images by some value:

$ docker images | grep somevalue 

References

  • docker images filtering
  • docker docs
like image 79
study Avatar answered Sep 28 '22 10:09

study