如何删除7天前自动创建的Docker镜像? [英] How to remove docker images which created 7 days ago automatically?
本文介绍了如何删除7天前自动创建的Docker镜像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
几天前是否可以删除内置的docker镜像?
Is there a way to remove built docker images some days ago?
如果我们检查 docker镜像
,将会得到:
If we check docker images
, will got:
REPOSITORY TAG IMAGE ID CREATED SIZE
存在一个已创建
的项目。
根据< href = https://docs.docker.com/engine/reference/commandline/rmi/ rel = noreferrer>官方文档,找不到相应的选项。
Researched from the official document, didn't find an option for that.
推荐答案
docker image prune 提供了一个过滤器,用于删除直到特定日期的图像:
docker image prune provides a filter to remove images until a specific date:
docker image prune -a --filter "until=$(date +'%Y-%m-%dT%H:%M:%S' --date='-15 days')"
这篇关于如何删除7天前自动创建的Docker镜像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文