Sign inSign up

mkodockx/docker-image-take-down

By mkodockx

Updated almost 11 years ago

Unused cyclic docker image cleaner within a docker container.

Image
0

1.1K

mkodockx/docker-image-take-down repository overview

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'.

Tag summary

Content type

Image

Digest

sha256:0349a4dcd

Size

67.3 MB

Last updated

almost 11 years ago

docker pull mkodockx/docker-image-take-down