How to List and Delete Docker Images - Little Big Extra Skip to main content

How to List and Delete Docker Images

Introduction

Docker image is an immutable file composed of layers of other images.In this tutorial, I will list out various useful commands to list, delete or remove docker images and also fix some common errors with below commands.

Listing the images

  • To list all Docker Images

  • To list Docker Images including composition of layers

  • To list just the Image ID’s of Docker Images

  • To list all dangling images (dangling images are one which is not being referenced by any container and just using disk space)

 

Deleting the images

  • To delete/remove a particular Image use

  • To delete all dangling images from your docker host (dangling images are one which is not being referenced by any container and just using disk space)

  • To delete all images

  • To delete a single docker image forcefully, even when being used by a container

  • To delete all docker image forcefully, even when they are being used by container

 

Common Errors while using above commands

  • Your Image ID is not correct, check if you are not using container ID by mistake (docker ps -a). Use above commands to get correct Image ID

 

The image reference is being used by the running container.

  1. Either stop the container and remove the image

    OR

2. Forcefully stop the container and remove the image using

 

 

 

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami