Public | Automated Build

Last pushed: 2 years ago
Short Description
Cleanup old Deis builds
Full Description

Delete old Releases of Docker Images

If you release often your build server will collect a large amount of images that are no longer used.
This script keeps your Deis cluster slick by removing app versions that are older than n releases.


You need to mount the docker socket into the container in order for the script
to access and cleanup the images.

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dreipol/cleanup-deis-images


You can specify how many versions should be kept (4 per default) by setting

docker run --rm \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -e KEEP_LAST_VERSIONS=3 dreipol/cleanup-deis-images

If you have images from v2 up to v6 the script will remove all images
older than v6 - n. With the default of 4 this will
only remove the image

Daily Fleet Schedule

You can use the cleanup-images.service file together with the cleanup-iamges.timer unit
to regularly schedule a cleanup of your machines via fleet.

fleetctl start cleanup-images
fleetctl start cleanup-images.timer
Docker Pull Command
Source Repository