No description, website, or topics provided.
Go Makefile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Makefile
README.md
main.go
wercker.yml

README.md

go-clear-docker-images

  • Removes all stopped containers
  • Removes all untagged images ( if possible )
  • Preserves X of images tagged in the same way
  • Uses whitelist to ignore images which you want to keep at all cost

Requires following ENV variables:

DOCKER_HOST : tcp://192.168.99.100:2376 | unix://var/run/docker.sock
DOCKER_TLS_VERIFY : 1|0
DOCKER_CERT_PATH : `pwd` | /home/potato

Usage

Usage of ./docker-images-cleanup.bin:
  -containers-older-than int
        Removes containers inactive for more than X seconds. (default 300)
  -debug
        Print out what's going to be remove without touching stuff
  -images-older-than int
        Removes images older than X seconds. (default 1209600)
  -preserve int
        Numbers of images to preserve even if older than required (default 3)
  -whitelist string
        Whitelisted images, comma separated (default "postgres,ubuntu,golang")
Latest release available here.