Linux command
docker-rmi 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Remove an image
docker rmi [image]
Remove multiple images
docker rmi [image1] [image2]
Force remove
docker rmi -f [image]
Remove all dangling images
docker rmi $(docker images -f dangling=true -q)
Remove by image ID
docker rmi [image_id]
说明
docker rmi removes one or more images. Images in use by containers cannot be removed unless forced. Shorthand for docker image rm. Removing an image deletes all its layers unless they're shared with other images. Dangling images are untagged images that are no longer referenced by any tagged image.
参数
- -f, --force
- Force removal.
- --no-prune
- Do not delete untagged parent images.
FAQ
What is the docker-rmi command used for?
docker rmi removes one or more images. Images in use by containers cannot be removed unless forced. Shorthand for docker image rm. Removing an image deletes all its layers unless they're shared with other images. Dangling images are untagged images that are no longer referenced by any tagged image.
How do I run a basic docker-rmi example?
Run `docker rmi [image]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --force do in docker-rmi?
Force removal.