docker 删除映像

Docker RMI (Docker rmi)

docker rmi removes images by their ID.

docker rmi通过其ID删除图像。

To remove the image, you first need to list all the images to get the Image IDs, Image name and other details. By running simple command docker images -a or docker images.

要删除图像,首先需要列出所有图像以获取图像ID,图像名称和其他详细信息。 通过运行简单命令docker images -adocker images

After that you make sure which image want to remove, to do that executing this simple command docker rmi <your-image-id>. Then you can confirm that image has been removed or not by list all the images and check.

之后,确定要删除的图像,然后执行此简单命令docker rmi <your-image-id> 。 然后,通过列出所有图像并检查,可以确认图像是否已删除。

删除多张图片 (Remove multiple images)

There is a way to remove more than one images at a time, when you want to remove multiple specific images. So to do that first get Image IDs simply by listing the images then execute simple followed command.

当您要删除多个特定图像时,可以使用一种方法一次删除多个图像。 为此,首先只需列出图像即可获取图像ID,然后执行简单的后续命令。

docker rmi <your-image-id> <your-image-id> ...

docker rmi <your-image-id> <your-image-id> ...

Write Images IDs in the command followed by the spaces between them.

在命令中写入图像ID,后跟空格。

一次删除所有图像 (Remove all images at once)

To remove all images there is a simple command to do that. docker rmi $(docker images -q)

要删除所有图像,有一个简单的命令可以做到。 docker rmi $(docker images -q)

Here in the above command, there are two command the first which execute in the $() is shell syntax and returns the results whatever executed in that syntax. So in this -q- is a option is used to provide to return the unique IDs,$() returns the results of image IDs and then docker rmi removes all those images.

在上面的命令中,有两个命令,第一个在$()执行的命令是shell语法,并返回以该语法执行的结果。 因此,在此-q- is a option is used to provide to return the unique IDs, $()返回图像ID的结果,然后docker rmi删除所有这些图像。

想要查询更多的信息: (For More Information:)

  • Docker CLI docs: rmi

    Docker CLI文档:rmi

码头工人 (Docker rm)

docker rm removes containers by their name or ID.

docker rm通过容器的名称或ID删除容器。

When you have Docker containers running, you first need to stop them before deleting them.

当您运行Docker容器时,首先需要停止它们,然后再删除它们。

  • Stop all running containers: docker stop $(docker ps -a -q)

    停止所有正在运行的容器: docker stop $(docker ps -a -q)

  • Delete all stopped containers: docker rm $(docker ps -a -q)

    删除所有停止的容器: docker rm $(docker ps -a -q)

删除多个容器 (Remove multiple containers)

You can stop and delete multiple containers by passing the commands a list of the containers you want to remove. The shell syntax $() returns the results of whatever is executed within the brackets. So you can create your list of containers within this to be passed to the stop and rm commands.

您可以通过向命令传递要删除的容器列表来停止和删除多个容器。 shell语法$()返回括号中执行的任何结果。 因此,您可以在其中创建容器列表,以传递给stoprm命令。

这是docker ps -a -q的细目分类 (Here is a breakdown of docker ps -a -q)

  • docker ps list containers

    docker ps列表容器

  • -a the option to list all containers, even stopped ones. Without this, it defaults to only listing running containers

    -a列出所有容器,甚至停止容器的选项。 没有这个,它默认只列出正在运行的容器

  • -q the quiet option to provide only container numeric IDs, rather than a whole table of information about containers

    -q安静选项仅提供容器数字ID,而不提供有关容器的整个信息表

更多信息: (More Information:)

  • Docker CLI docs: rm

    Docker CLI文档:rm

有关Docker中映像的更多信息: (More info about images in Docker:)

  • Docker image guide

    Docker映像指南

  • Where are Docker images stored?

    Docker映像存储在哪里?

有关Docker中容器的更多信息: (More info about containers in Docker:)

  • How to automate Docker container deployment

    如何自动化Docker容器部署

  • How to fix Docker container vulnerabilities

    如何修复Docker容器漏洞

有关Docker的更多信息: (More info about Docker:)

  • A beginner's guide to Docker

    Docker初学者指南

  • Docker DevOps course (free video course)

    Docker DevOps课程(免费视频课程)

  • Docker 101: from creation to deployment

    Docker 101:从创建到部署

翻译自: https://www.freecodecamp.org/news/how-to-remove-images-in-docker/

docker 删除映像

docker 删除映像_如何在Docker中删除映像和容器相关推荐

  1. java数组删除数组元素_如何在Java中删除数组元素

    java数组删除数组元素 When we create an array in Java, we specify its data type and size. This is used by JVM ...

  2. python怎么去掉换行符_如何在Python中删除尾部换行符?

    如何在Python中删除尾部换行符? 什么是Perl的chomp函数的Python等价物,如果它是换行符,它会删除字符串的最后一个字符? 26个解决方案 1473 votes 尝试方法lstrip() ...

  3. textarea选中行删除_Easy Data Transform如何在Excel中删除重复的行?

    Excel用户经常希望删除具有重复值的行.例如,要删除包含重复电子邮件的行,那么Easy Data Transform如何在Excel中删除重复的行?下面一起来看看吧. 先在您的Mac上安装Easy ...

  4. aws 删除ec2实例_如何在AWS中启动EC2实例

    aws 删除ec2实例 你好朋友, 在本教程中,我们将看到如何立即在AWS中旋转EC2实例. 您应该有权访问AWS控制台.如果您还没有AWS账户,则可以单击此处并在AWS上创建免费套餐. 如何在AWS ...

  5. groupdel 删除组_如何在Linux中删除组– groupdel命令

    groupdel 删除组 Linux groupdel command is used to delete a group. This is a very powerful command, so u ...

  6. linux删除用户所有信息_如何在Linux上删除用户(以及删除所有跟踪)

    linux删除用户所有信息 Fatmawati Achmad Zaenuri/ShutterstockFatmawati Achmad Zaenuri / Shutterstock Deleting ...

  7. commit git 删除文件夹_从Git提交中删除文件

    现有的答案都在谈论从上一次提交中删除不需要的文件. 如果要从旧提交(甚至推送)中删除不需要的文件,并且不想创建新提交,则由于该操作,这是不必要的: 1. 查找您要文件符合的提交. git checko ...

  8. 删除非空目录linux_如何在Linux中删除空的非空目录

    删除非空目录linux Linux file system consist of directories. A system administrator generally work with dir ...

  9. 删除word中所有的表格_如何在Word中删除表格

    删除word中所有的表格 If you've inserted a table in Word and you now want to delete it, you may have found it ...

最新文章

  1. 解决存储过程中数据安全问题的四种方式
  2. itx机箱尺寸_乔思伯发布ITX机箱V8,采用独特抽拉式结构
  3. 【Linux】26_文件服务FTP Server
  4. Python3 使用[]提取字符
  5. getparameter方法中文显示问号解决方法_电脑显示器花屏怎么办 电脑显示器花屏解决方法【原因分析】...
  6. unity3d软阴影和硬阴影的原理_Unity3D中两种默认阴影的实现
  7. Java毕设项目电影票网上订票系统计算机(附源码+系统+数据库+LW)
  8. python二级题库(百分之九十原题) 刷题软件推荐 第六套
  9. ASUS C302C Chromebook Windows声卡驱动
  10. R语言Fisher检验的workspace问题
  11. python快手爬虫:解决粉丝数、 关注数等字体加密
  12. 爱了爱了,这样的文字动画让你爱不释手
  13. CPU运算器、控制器、寄存器
  14. Excel对隐藏的多个工作表一键批量命名的操作
  15. 北邮工程计算-知识点索引--十安辰
  16. ExtJs 第二章,Ext.form.Basic表单操作
  17. Matlab 2014a安装文件下载、安装教程及破解教程!!!
  18. 学C语言和英语水平的关系顶多不过半毛
  19. 苹果手机的隐藏功能分享
  20. 前端性能优化,之还在为多种多样的知识点整理苦恼吗,进来看看吧。

热门文章

  1. 断开式绑定数据在comboBox中 winform
  2. 类的定义与抽取 java 1615134563
  3. 测试markdown的发布
  4. git-分支管理-增加删除切换合并操作
  5. django-普通的cookie操作
  6. django-编辑学生
  7. python导出mysql授权语句
  8. 我们如何在Linkerd 2.2里设计重试
  9. 根据个人亲身进阶架构师经历系统构建20大进阶架构师专题!
  10. JavaWeb14-HTML篇笔记(一)