Script attempts to remove non-local docker volume (noop, but still)
Take volume output like the following:
$ docker volume ls
DRIVER VOLUME NAME
rancher-secrets 5e41a869acdb6a76c0cbf3212a358f72f96254b94bb3eebeb28d04b1171f3708
rancher-secrets 5ffeab5ad23e1f15705ade81b41677d6875f9cca5b33efde8149a43f6904853b
rancher-secrets 8c0744a2e9c3b15fcd42225b140716d6848bbfb01754de17f08d373cbd0f3aed
rancher-secrets 9774cc2270aad64b81cfa52db62d76ceebed4d2b183fa0c0ade34d2f3bcc6cc7
rancher-secrets c7b8416d75b3baa24cb500e28e3e1a29ce7df3ef530496b5d087ec9c0bef6739
rancher-nfs dev-mysql-etc
local f258cd3613f345121bafeb1643dd0849d698cb9058fecf25506a2dcf2998da77
rancher-secrets f3ac3d0bf7d9484b2483d7eafba72c4be204feeb648bb40b760855301e1e92ba
rancher-nfs openvpn-etc
rancher-nfs postfix-log
rancher-nfs postfix-spool
local rancher-agent-state
local rancher-cni
local rancher-cni-driver
rancher-nfs runner01-etc
rancher-nfs runner02-etc
rancher-nfs sq-content
rancher-nfs sq-content-dev
Every one of the non-local volumes is managed by a volume driver and cannot be managed by docker volume, yet the script still identifies them as unused volumes and attempts to remove them.
This can be fixed by adding the filter of driver=local to the command on line 85 as follows:
docker volume ls -f driver=local,dangling=true -q
this repo looks like it's not maintained anymore... this PR should be merged years ago. I created a fork and an image with this the driver=local flag and added an environment variable DEL_VOLUMES so by default it's not enabled. If its useful feel free to use/fork it here is:
docker pull zakkg3/docker-cleanup
thanks, oskapt
Won't fix due to retiring project