Browse Source

Install a docker registry GC cron

This installs a daily cron job for garbage collecting the docker
registry. Note that we need to orphan blobs by deleting their tags for
this to result in any cleaned up blobs. This will be done in a separate
change.

Change-Id: I85c87ee3b3a375e0141ef9b15a0b9e56c0938bd8
changes/55/652755/1
Clark Boylan 1 month ago
parent
commit
671250095d
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      playbooks/roles/registry/tasks/main.yaml

+ 7
- 0
playbooks/roles/registry/tasks/main.yaml View File

@@ -44,3 +44,10 @@
44 44
   shell:
45 45
     cmd: docker-compose up -d
46 46
     chdir: /etc/registry-docker/
47
+
48
+- name: Install cron to garbage collect the registry daily
49
+  cron:
50
+    name: "docker registry garbage-collect"
51
+    minute: "0"
52
+    hour: "0"
53
+    job: "/usr/bin/docker exec registrydocker_registry_1 registry garbage-collect /etc/docker/registry/config.yml > /dev/null"

Loading…
Cancel
Save