搜索镜像
docker search tutorial
下载镜像
docker pull learn/tutorial
由于前天的粗心,造成下载名称写错成 “tutorial”,导致下载时需要登陆,这是错误的,现在已经更正。
显示镜像
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
learn/tutorial latest a7876479f1aa 4 years ago 128MB
删除镜像
docker rmi a7876479f1aa
此时发生错误,需要停止容器
Error response from daemon: conflict: unable to delete a7876479f1aa (must be forced) - image is being used by stopped container a1165e08afb0
查询容器
docker ps -a
删除容器
docker rm a1165e08afb0
然后再继续执行删除镜像命令,知道所有依赖的容器都删除
docker rmi a7876479f1aa
Untagged: learn/tutorial:latest
Untagged: learn/tutorial@sha256:2933b82e7c2a72ad8ea89d58af5d1472e35dacd5b7233577483f58ff8f9338bd
Deleted: sha256:a7876479f1aae32c0716d7a85b5151af26f533fe48efa086010105cba02f5163
删除镜像成功
网友评论