Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.19 KB

README.md

File metadata and controls

41 lines (26 loc) · 1.19 KB

Periodic docker prune

head

The problem

When running a swarm, periodicaly updating service images, each worker node starts to hold stale versions of old images, taking disk space.

Common solution is to run docker prune via cron, but we do not want to configure our workers besides joining to the swarm, aren't we?

So this image is designed for running periodic system clean with zero host configuration.

Swarm

version: '3.6'

services:
  periodic-prune:
    image: f213/periodic-docker-prune:1.1.0
        
    # may be omitted, 05:24 by default
    environment:
      AT: '02:44'

    deploy:
      mode: global
      
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      

Manual

$ docker run -v "/var/run/docker.sock:/var/run/docker.sock" -e AT='17:20' f213/periodic-docker-prune