Sign inSign up

lhanxetus/deckschrubber

By lhanxetus

Updated over 7 years ago

Docker Registry cleanup runner

Image
0

1M+

lhanxetus/deckschrubber repository overview

Deckschrubber

n. person responsible for scrubbing a ship's deck.

Deckschrubber inspects images of a Docker Registry and removes those older than a given age.

Arguments

-v    shows version and quits
-debug
      run in debug mode
-dry
      does not actually deletes
-registry string
      URL of registry (default "http://localhost:5000")
-username string
      username for docker login
-password string
      password for docker login
-insecure
      ignore https verification error
-repos
      matching repositories by name (allows mulitple value seperates by ,); If specified will ignore `-repo_regexp`
-repo_regexp string
      matching repositories (allows regexp) (default ".*")
-max_repos int
      max number of repositories to garbage collect (default to no limit)
-tag_regexp string
      matching tags (allows regexp) (default ".*")
-latest int
      number of the latest matching images of an repository that won't be deleted (default 1)
-year int
      max age in years
-month int
      max age in months
-day int
      max age in days
     

Examples

  • Remove all images older than 2 months and 2 days
docker run --rm --name registry-retention-runner lhanxetus/deckschrubber -month 2 -day 2
  • Remove these images older than 1 year from http://myrepo:5000
docker run --rm --name registry-retention-runner lhanxetus/deckschrubber -year 1 -registry http://myrepo:5000 -repos myproject/myimage,myproject/otherimage -username myself -password mypwd
  • Remove all images of each repository except the 3 latest ones
docker run --rm --name registry-retention-runner lhanxetus/deckschrubber -latest 3 
  • Remove all images with tags that ends with '-SNAPSHOT'
docker run --rm --name registry-retention-runner lhanxetus/deckschrubber -tag_regexp '^.*-SNAPSHOT$' 

Github repo

Tag summary

Content type

Image

Digest

Size

5.7 MB

Last updated

over 7 years ago

docker pull lhanxetus/deckschrubber