The docker image rm command lets you remove images from the Docker host. This command can remove one or more images, and you can specify images using one of the following identifiers:
- The image's short ID.
- The image's long ID.
- The image's digest.
- The image's name along with its tag. If the tag is not specified, then the latest tag is assumed by default.
If the image happens to have more than one tag associated with it, then those tags must be removed before removing the image. Alternatively, you can forcefully remove them using the -f or --force option of the docker image rm command. In such a case, all the tags will also be automatically removed.
Here is the syntax for the docker image rm command:
docker image rm [OPTIONS] IMAGE [IMAGE...]
In this recipe, we will create multiple tags for an image and demonstrate how to remove them.
...