Skip to content

Docker swarm data prune

Deepak Narayana Rao edited this page Oct 24, 2017 · 1 revision

Context

Docker takes a conservative approach to cleaning up unused objects (often referred to as “garbage collection”), such as images, containers, volumes, and networks: these objects are generally not removed unless you explicitly ask Docker to do so. This can cause Docker to use extra disk space. For each type of object, Docker provides a prune command. In addition, you can use docker system prune to clean up multiple types of objects at once. This topic shows how to use these prune commands.

More info on: https://docs.docker.com/engine/admin/pruning/

Prune setup in sunbird

  • Jenkins job Swarm_Agent_Docker_Prune is scheduled to run @midnight
  • Ansible role swarm-agent-docker-prune is used to prune unused images, containers and networks
  • Unused volumes are not pruned by above scripts because monitoring services have data volumes inside docker swarm. These data volumes will be marked as unused temporarily when the monitoring stack is removed during monitoring deployment. Hence it is dangerous to prune volumes automatically.
Clone this wiki locally