Docker Image cleaning easy automation with cron

less than 1 minute read

Docker makes it easy to ship your applications and services in containers so you can run them anywhere. The more you work with Docker it’s also easy to accumulate a huge number of unused images, containers, and data volumes in your filesystem that clutter the output and consume a lot of precious disk space.

Docker, in new versions, gives you all the tools you need to clean up your system from the command line. This bash script creates a cron-job every day at 8am so it takes responsibility over keeping your system clean, freeing disk space and keeping your system organized by removing unused Docker images, containers, and volumes.

Docker Image bash script to automate the cleaning