I want to get some specific information with docker api. In this case, I want to get the IMAGE ID that correspond to <none> of REPOSITORY with command docker images
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE <none> <none> ebeb5aebbeef 5 minutes ago 479MB build-embed latest 80636e4726f8 10 minutes ago 479MB <none> <none> a2abf2e07bc3 About an hour ago 1.38GB ubuntu 18.04 4e5021d210f6 5 weeks ago 64.2MB I tried the command as below:
$ docker images | grep `<none>' And get results:
<none> <none> ebeb5aebbeef 2 minutes ago 479MB <none> <none> a2abf2e07bc3 58 minutes ago 1.38GB How can I just only get the IMAGE ID? (like ebeb5aebbeef a2abf2e07bc3)
The purpose of this question is that I want to remove <none> images with docker api, like docker rmi $(docker images | grep <none>
Thank you all