How to Remove Old and Unused Docker Images

0 min read 123 words

If you need to remove any old and unused Docker images, then you can do the following:

How to Remove Old and Unused Docker Images

Firstly you need to see all the images:

docker images

You can also use ls to see the Docker Images:

docker image ls

How to Remove a Single Docker Image

The docker rmi command will remove a single Docker image as follows:

docker rmi <image_id>

You can also use the Docker image names as follows:

docker rmi ubuntu something

How to Remove Dangling Docker Images

docker images -f dangling=true

It’s also possible to prune images as follows:

docker image prune

You can also automatically find all the images and remove them directly:

docker rmi $(docker images -q -a)
Tags:
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags

Recent Posts