Removing old docker processes and images with unknown name

If you see lot of images without a name when you do “docker images”, it’s because of old processes that you can see when you do “docker ps -a”. These can be cleaned up by:

docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi

Change the grep word as you wish.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s