[DEPRECATED] Deckschrubber inspects images of a Docker Registry and removes those older than X
10K+
n. person responsible for scrubbing a ship's deck.
Deckschrubber inspects images of a Docker Registry and removes those older than a given age.
go get github.com/fraunhoferfokus/deckschrubber
$GOPATH/bin/deckschrubber
We run our own private registry on a server with limited storage and it was only a question of time, until it was full! Although there are similar approaches to do Docker registry house keeping (in Python, Ruby, etc), a native module (using Docker's own packages) was missing. This module has the following advantages:
-day int
max age in days
-debug
run in debug mode
-dry
does not actually delete
-frequency
repeat the task every X seconds
-insecure
Skip TLS verification
-latest int
number of the latest matching images of an repository that won't be deleted (default 1)
-month int
max age in months
-password string
password for authentication
-registry string
URL of registry (default "http://localhost:5000")
-repo string
matching repositories (allows regexp) (default ".*")
-repos int
number of repositories to garbage collect (default 5)
-tag string
matching tags (allows regexp) (default ".*")
-user string
username for authentication
-ntag string
match everything but this tag (allows regexp) (default empty)
-v shows version and quits
-year int
max age in days
Deckschrubber uses the Docker Registry API. Its delete endpoint is disabled by default, you have to enable it with the following entry in the registry configuration file:
delete:
enabled: true
See the documentation for details.
$GOPATH/bin/deckschrubber -month 2 -day 2
http://myrepo:5000$GOPATH/bin/deckschrubber -year 1 -registry http://myrepo:5000
$GOPATH/bin/deckschrubber -repos 30 -dry
$GOPATH/bin/deckschrubber -latest 3
$GOPATH/bin/deckschrubber -tag ^.*-SNAPSHOT$
Example docker-compose.yml:
version: "3"
services:
deckschrubber:
image: mobilejazz/deckschrubber:0.7.1
environment:
- REGISTRY=https://myregistry.example.com
- USER=admin
- PASSWORD=s00p3rs33cret
- FREQUENCY=86400 # 1 day in seconds
Content type
Image
Digest
Size
8.6 MB
Last updated
over 6 years ago
docker pull mobilejazz/deckschrubber