如何删除新的Docker图像

发布于 2025-02-12 08:50:12 字数 202 浏览 2 评论 0原文

我有一个脚本,基本上是从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蛮可爱 2025-02-19 08:50:12

没有办法自动执行此操作,但我建议您:

  1. 拉新图像。
  2. 运行Docker Image Prune -filter =< your_filter>按日期和/或标签过滤。

这是 filter aurg aurg groung offorment文档

There is no way to do it automatically, but I suggest you:

  1. Pull new image.
  2. Run docker image prune --filter=<YOUR_FILTER> filtering by a date and/or label.

Here is Filter aurgment official documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文