1 查看本地已用镜像文件

[root@localhost web]# docker images

Docker 删除 images

 2.删除镜像 Redis

[root@localhost web]# docker rmi 5958914cc558

Docker 删除 images

报错:image is being used by stopped container 569d84e1bc9f

3.查询容器

[root@localhost web]# docker ps -a

Docker 删除 images

4.停用容器 :sudo docker stop [CONTAINER ID ] 

5.删除容器:sudo docker rm  [CONTAINER ID]

6.删除镜像:sudo docker rmi [Image ID]

7.检查是否被删除:sudo docker images

详细操作见下图

Docker 删除 images

 


 

把学习测试用的所有的镜像全部删除

1.停止所有容器:docker stop $(docker ps -a -q)

2.删除所有容器:docker rm $(docker ps -a -q)

3.删除所有镜像:docker rmi $(docker images -q)

Docker 删除 images

 

Docker 删除 images

 

 这时候所有的镜像和容器,都被删除了

 

相关文章:

  • 2022-02-15
  • 2021-06-05
  • 2022-01-19
  • 2021-10-10
  • 2022-12-23
  • 2022-03-05
  • 2021-12-14
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-07-21
  • 2021-08-27
  • 2022-01-01
相关资源
相似解决方案