How automated cleanups work in HCS

Automated Cleanup

A guide on how automated cleanups work in HCS

HCS automatically cleans up your servers to prevent them from running out of disk space. It will remove all the unused Docker images, containers, and volumes.

How it works

  • HCS will run the cleanup script every 10 minutes.

  • If there is an ongoing deployment, the cleanup script will be skipped - to prevent any issues, like deleting the image that is currently being used.

  • The cleanup script will remove all the unused Docker images, containers, and volumes with the following commands:

# This will remove all unused Docker images
docker image prune -af
# This will remove all HCS.managed containers that are not running
docker container prune -f --filter "label=HCS.managed=true"
# This will remove all unused Docker build caches
docker builder prune -af

Last updated