docker安装的镜像文件如何完全卸载?

docker镜像卸载
docker镜像卸载

1、docker ps -a查看运行的镜像进程:

root@oracle-u-a1:~# docker ps -a
CONTAINER ID   IMAGE                  COMMAND        CREATED         STATUS                          PORTS     NAMES
5fcad40de5fc   6053537/portainer-ce   "/portainer"   5 minutes ago   Restarting (1) 28 seconds ago             prtainer
528bed031a7a   hello-world            "/hello"       24 hours ago    Exited (0) 24 hours ago                   flamboyant_matsumoto

2、docker stop CONTAINER ID例如要删除mysql镜像,停止该镜像进程:

root@oracle-u-a1:~# docker stop 5fcad40de5fc
5fcad40de5fc

3、docker rm CONTAINER ID卸载镜像:

root@oracle-u-a1:~# docker rm 5fcad40de5fc
5fcad40de5fc

4、docker images 查看当前docker的镜像IMAGE ID:

root@oracle-u-a1:~# docker images
REPOSITORY             TAG       IMAGE ID       CREATED        SIZE
6053537/portainer-ce   latest    0c8284f681fe   5 weeks ago    245MB
hello-world            latest    18e5af790473   2 months ago   9.14kB

5、docker rmi IMAGE ID 删除镜像:

root@oracle-u-a1:~# docker rmi 0c8284f681fe
Untagged: 6053537/portainer-ce:latest
Untagged: 6053537/portainer-ce@sha256:9b2dac3f7169d5fda64704b6e5d638465e15f7669edf7ad6a5c52d48b8a3ead7
Deleted: sha256:0c8284f681fe192b85a8f9de03da017318ea2893381bc2200f9151971ceacc11
Deleted: sha256:22a6f830d1426ddab67999f46bc52d28c1e6bddb77ad168199a8fdc59bee60d5
Deleted: sha256:2fc2682248a501254231811d20f8d98cea1a3e730a3be3e6f20401e90294c498
Deleted: sha256:1627894e55f67b82225e47baae59b25240b7e7b6eb5ee2b40530ad325dc03443
滚动至顶部
扫描微信二维码联系我们 关闭