如果要删除已拉取的图像 几个月前,您可以尝试以下示例删除三个月前创建的图像:
three_months_old_images=`docker images | grep -vi "<none>" | tr -s ' ' | cut -d" " -f3,4,5,6 | grep "3 months ago" | cut -d" " -f1` docker rmi $three_months_old_images