initial commit, here be dragons
This commit is contained in:
9
roles/docker/files/docker-prune.service
Normal file
9
roles/docker/files/docker-prune.service
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Docker Housekeeping
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Nice=19
|
||||
IOSchedulingClass=2
|
||||
IOSchedulingPriority=7
|
||||
ExecStart=/usr/local/bin/docker-prune.sh
|
10
roles/docker/files/docker-prune.sh
Normal file
10
roles/docker/files/docker-prune.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# prune *all* images not currently used
|
||||
docker image prune -af
|
||||
# prune unused volumes (we keep all state host-mounts)
|
||||
docker volume prune -f
|
||||
# prune images, containers, networks etc. but keep potentially used one (no -a)
|
||||
docker system prune -f
|
||||
# update left-over images
|
||||
docker images | grep -v "^REPO" | grep -v "^<none>" | sed 's/ \+/:/g' | cut -d: -f1,2 | xargs -L1 docker pull
|
2
roles/docker/files/docker-prune.timer
Normal file
2
roles/docker/files/docker-prune.timer
Normal file
@ -0,0 +1,2 @@
|
||||
[Timer]
|
||||
OnCalendar=Mon 12:04
|
Reference in New Issue
Block a user