cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove old and unused Docker images

williamsmith900
New Contributor

When running Docker for a long time, there are a lot of images in the system. How can I remove all unused Docker images at once safely to free up the storage?

In addition, I also want to remove images pulled months ago, So, I'm not asking for removing untagged images only. I'm searching for a way to remove general unused images.

I checked one docker blog online, but still, I was able to get rid of this problem.

Anyone can help!

2 REPLIES 2

Prabakar
Databricks Employee
Databricks Employee

@william smith​ you can use the prune command to remove the unused docker image.

docker image prune -a --force --filter "until=720h"

This command removes images created more than 30 days (720h) ago.

You need to modify the filter parameter as per your requirement.

Official docker document should help you.

Anonymous
Not applicable

Hey there @william smith​ 

Hope everything is going great!

Does @Prabakar Ammeappin​'s response answer your question? If yes, would you be happy to mark it as best so that other members can find the solution more quickly? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group