How to filter Docker images by platform?

2019-08-23 04:57发布

问题:

I am using LCOW and WCOW at the same time on a Windows 10 machine. There are lots of images in both platforms. I want to see all the images of a specific platform.

Is there a way to make docker images show only the images that are for e.g. Linux?

回答1:

You can find the docker image platforms using the command

docker image inspect <image id>

Look for the "Os" attribute value

To list all the images and their respective OSs

for i in `docker images --format {{.ID}}`; do echo $i `docker image inspect $i |grep Os`; done


标签: docker