docker rmi
The docker rmi command is used to remove one or more Docker images from your local Docker host. This command deletes the specified images, freeing up space and helping to manage your local image repository.
Basic Syntax
Key Options and Parameters
-f, --force: Force the removal of an image.
docker rmi -f myimage--no-prune: Do not delete untagged parent images.
docker rmi --no-prune myimage
Examples
Removing a Single Image
docker rmi myimageThis command removes the image named
myimage.Removing Multiple Images
docker rmi image1 image2 image3This command removes the images named
image1,image2, andimage3.Forcing the Removal of an Image
docker rmi -f myimageThis command forcefully removes the image named
myimage.Removing an Image Without Pruning Parent Images
docker rmi --no-prune myimageThis command removes the image named
myimagebut does not delete any untagged parent images.
Conclusion
The docker rmi command is essential for removing Docker images from your local Docker host. Understanding its options and parameters allows you to effectively manage and clean up images on your Docker host.