How can I delete Docker images by tag, preferably with wildcarding?

前端 未结 2 1634
北海茫月
北海茫月 2020-12-23 00:26

I have some automated processes that spew a bunch of Docker images tagged with meaningful labels. The labels follow a structured pattern.

Is there a way to find and

2条回答
  •  梦毁少年i
    2020-12-23 01:24

    Using only docker filtering:

     docker rmi $(docker images --filter=reference="*:stuff_*" -q)
    
    • reference="*:stuff_*" filter allows you to filter images using a wildcard;
    • -q option is for displaying only image IDs.

提交回复
热议问题