如何删除新的Docker图像
我有一个脚本,基本上是从docker-compose文件中摘下所有图像,然后运行该文件。但是,在拉这些图像时,我想删除以前的图像。
IE
我有此图像:repo/映像:1.0 我拉了此图像:回购/图像:2.0
如何删除repo/image:1.0
在拉动新图像时?
I have a script that basically pulls all the images from a docker-compose file and then runs that file. However, when pulling these images I want to remove the previous ones.
i.e.
I have this image: repo/image:1.0
And I pull this image: repo/image:2.0
How do I remove the repo/image:1.0
whilst pulling the new one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有办法自动执行此操作,但我建议您:
Docker Image Prune -filter =< your_filter>
按日期和/或标签过滤。这是 filter aurg aurg groung offorment文档。
There is no way to do it automatically, but I suggest you:
docker image prune --filter=<YOUR_FILTER>
filtering by a date and/or label.Here is Filter aurgment official documentation.