./services --help
Removes old (after time threshold) docker swarm services.
Usage: services [options]
--threshold=[TIME] (required) Relative time threshold, example: "2 days ago"
--destructive Run in destructive mode
--host=[URI|SOCKET] Remote docker uri (http://...) or local socket (unix://...), default: unix:///var/run/docker.sock
--exclude-names=[STRING,STRING]
Exclude name from deletion processDry-run to show what will be delete
./services --threshold="2 days ago" --exclude-names="registrator"and then real deletion
./services --threshold="2 days ago" --exclude-names="registrator" --destructiveIn case you want temporary remote connection to /var/run/docker.sock from other host (eg. local machine) you can use
socat (described in Forwarding TCP-traffic to a UNIX socket).
For example, for remote port 11111
./services --host="http://remote-swarm-host:11111" --threshold="2 days ago" --exclude-names="registrator" --destructive- Periodical running without cron
- Image cleaner by [age, count].[min,max] conditions