Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathanejohnson/docker-registry-pruner
Tool for batch-deletion of manifests by tag from a private docker registry.
https://github.com/nathanejohnson/docker-registry-pruner
Last synced: 26 days ago
JSON representation
Tool for batch-deletion of manifests by tag from a private docker registry.
- Host: GitHub
- URL: https://github.com/nathanejohnson/docker-registry-pruner
- Owner: nathanejohnson
- Created: 2019-02-14T19:34:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-04T04:18:49.000Z (over 4 years ago)
- Last Synced: 2024-09-23T09:08:18.440Z (about 2 months ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Docker registry pruner
======================This is a tool for batch deleting manifests from a private Docker registry.
`docker-registry-pruner` [deletes through the registry HTTP API](https://docs.docker.com/registry/spec/api/#deleting-an-image)
so it does not actually remove images from the registry storage, it just removes the manifest and tags. If you then want
to free up some space, [run the registry garbage collector](https://docs.docker.com/registry/garbage-collection/#run-garbage-collection)
which will remove dangling layers from storage.Configure and run it
--------------------`docker-registry-pruner` accepts parameters as flags (eg `docker run cego/docker-registry-pruner -minage 24h`) and as environment
variables with the prefix `DOCKER_REGISTRY_PRUNER_` (eg. `docker run -e DOCKER_REGISTRY_PRUNER_MINAGE=24h cego/docker-registry-pruner`).To get a description of the available flags, run `docker run cego/docker-registry-pruner -h`.
Building
--------To build the docker image just do the usual `docker build .`.
`docker-registry-pruner` is written in Go and the binary can be build with the usual `go get . && go build .` from within your `$GOPATH`.
If you'd rather not set up a Go build environment on your machine, you can also built it using the golang docker image, like so:docker run --rm \
-v /tmp/golang_docker-registry-pruner:/go \
-v $(pwd):/go/src/github.com/cego/docker-registry-pruner \
-w /go/src/github.com/cego/docker-registry-pruner \
golang:1.8 go get .
docker run --rm \
-v /tmp/golang_docker-registry-pruner:/go \
-v $(pwd):/go/src/github.com/cego/docker-registry-pruner \
-w /go/src/github.com/cego/docker-registry-pruner \
-e CGO_ENABLED=0 \
golang:1.8 go build -a .