Prune docker images after docker-compose up

This ensures that we cleanup images that are superceded and no longer
necessary. We do this to avoid filling the disk with docker images.

Note that we use the -f flag to avoid being prompted by docker image
prune for confirmation.

Change-Id: I8eb5bb97d8c66755e695498707220c9e6e7b2de0
This commit is contained in:
Clark Boylan 2019-05-02 15:08:55 -07:00
parent fa0f5860d2
commit f4bf952f34
4 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,9 @@
shell:
cmd: docker-compose up -d --timeout 60
chdir: /etc/gitea-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
- name: Check if root user exists
uri:
url: "https://localhost:3000/api/v1/users/root"

View File

@ -28,3 +28,6 @@
shell:
cmd: docker-compose up -d
chdir: /etc/haproxy-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f

View File

@ -49,6 +49,9 @@
shell:
cmd: docker-compose up -d
chdir: /etc/registry-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
- name: Install cron to garbage collect the registry daily
cron:

View File

@ -15,3 +15,6 @@
shell:
cmd: docker-compose up -d
chdir: /etc/zuul-preview-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f