Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter docker images by repository name

Tags:

docker

Using the command docker images, you can list all images on your host:

REPOSITORY                   TAG                 IMAGE ID            CREATED             VIRTUAL SIZE scdockerdemo_php             latest              155d80ea7642        4 minutes ago       265.3 MB scdockerdemo_node            latest              6189bc65c3fe        8 minutes ago       861.4 MB php                          5.6-apache          fc50bce69ea0        3 days ago          481.3 MB node                         4.1                 fc81e574af43        3 days ago          641.1 MB 

With docker images -f "tag=latest", you can filter for images with a certain tag.

How can I filter for a repository name? E.g. docker images -f "repository=scdockerdemo_*"

This command always return Invalid filter 'repository'

https://docs.docker.com/reference/commandline/images/

like image 942
kuffel Avatar asked Sep 27 '15 19:09

kuffel


People also ask

How do I list images in docker repository?

List images by name and tag. The docker images command takes an optional [REPOSITORY[:TAG]] argument that restricts the list to images that match the argument. If you specify REPOSITORY but no TAG , the docker images command lists all images in the given repository. The [REPOSITORY[:TAG]] value must be an “exact match” ...

What is the command to pull multiple docker images from a repository?

Pull a repository with multiple images To pull all images from a repository, provide the -a (or --all-tags ) option when using docker pull .

How do I remove a docker image from a repository?

To remove the image, you first need to list all the images to get the Image IDs, Image name and other details. By running simple command docker images -a or docker images . After that you make sure which image want to remove, to do that executing this simple command docker rmi <your-image-id> .


Video Answer


1 Answers

If you want to filter by repository name(eg: testImage), just use the following:

docker images testImage 

When you have multiple images with same repository name but diffetent tags, you can specify tags on the repository name by using a ':' ( For example, testImage:<whatever tag>)

Source: Docker images

like image 190
Vikas Avatar answered Sep 20 '22 14:09

Vikas