1.查询本地的images镜像
root@me:/home/me/Desktop/osem-master# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
friendhello latest 6f0e97a41dad 5 days ago 148MB
me/get-started part2 6f0e97a41dad 5 days ago 148MB
python 2.7-slim 52ad41c7aea4 3 weeks ago 139MB
2. docker rmi 删除镜像
root@me:/home/me/Desktop/osem-master# docker rmi 6f0e97a41dad
Error response from daemon: conflict: unable to delete 6f0e97a41dad (must be forced)
- image is referenced in multiple repositories #镜像在多个储存库中被引用
IMAGE ID 相同:(在pull时,出现了相同ID 不同 REPOSITORY 的image)
3.以repository和tag的方式删除image
root@me:/home/me/Desktop/osem-master# docker rmi friendhello:latest
Untagged: friendhello:latest
root@me:/home/me/Desktop/osem-master# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
me/get-started part2 6f0e97a41dad 5 days ago 148MB
python 2.7-slim 52ad41c7aea4 3 weeks ago 139MB
root@me:/home/me/Desktop/osem-master# docker rmi 6f0e97a41dad
Untagged: me/get-started:part2
Deleted: sha256:6f0e97a41dadd4339a582d199772c969128f0232242199729ed3c73b910d72b8
Deleted: sha256:e6e196d15d38444b1051f474b3dbc8e78fa55897e12567662cec9c640e0eddad
Deleted: sha256:9d96056b39a8a05d8154ac93d61ae789d757783dbe31332a87ef823f19bfb6b3
4.删除全部image
docker rmi $(docker images -q)