Public | Automated Build

Last pushed: 2 years ago
Short Description
Unused cyclic docker image cleaner within a docker container.
Full Description

docker-image-take-down

Scans the images loaded by the docker container and takes down old not used ones.

So it provides a way of automatic cleaning of unused images.

#Usage

##Quickstart

    docker run -d \
      -v /var/run:/var/run:rw \
      -v /opt/dockx/management/imgs/docker:/usr/bin/docker:r \
      -e SUSPEND_DURATION=1800s \
      -e DELAY_DURATION=5m \
      -e IMAGES_TO_PRESERVE="debian, ubuntu:latest" \
      mkodockx/docker-image-take-down

##Environment Variables

###DELAY_DURATION

You can pass a duration here to define how long the process should wait before starting the clean task after unused image detection.

e.g. 20m or 5h

###SUSPEND_DURATION

A duration that defines how long the process will wait after taking down unused images and start the wipe procedure again.

Caution

DELAY_DURATION and SUSPEND_DURATION sum up for each cycle. 30m delay and one hour suspend create a cycle of one and a half hour per cleaning cycle.

###IMAGES_TO_PRESERVE

You may want to keep some images anyway. Set the value of IMAGES_TO_PRESERVE to a comma seperated list of the images' names you don't want to be taken down.

#More Info

Based on an idea by 'tutum'.

Docker Pull Command
Owner
mkodockx
Source Repository

Comments (0)