Deleting Images

Learn to properly delete Docker images.

We'll cover the following

When you no longer need an image on your Docker host, you can delete it with the docker image rm command. rm is short for “remove.”

Deleting an image will remove the image and all of its layers from your Docker host. This means it will no longer show up in docker image ls commands, and all directories on the Docker host containing the layer data will be deleted. However, if an image layer is shared by more than one image, that layer will not be deleted until all images that reference it have been deleted.

Get hands-on with 1000+ tech skills courses.