1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00
This commit is contained in:
kev 2021-12-14 17:07:27 +08:00
parent 0382542699
commit 27e423fa9d
3 changed files with 18 additions and 0 deletions

View File

@ -4,7 +4,18 @@ registry-cli
[registry-cli][1] is a script for easy manipulation of docker-registry from command line (and from scripts)
```
# extract binary (good luck)
$ docker run --rm -v $PWD:/tmp --entrypoint cp vimagick/registry-cli /usr/local/bin/registry-cli /tmp
$ ./registry-cli --help && mv registry-cli /usr/local/bin
[19012] Error loading Python lib '/tmp/_MEI7rjw5j/libpython3.10.so.1.0'
# make an alias
$ alias registry-cli='docker run --rm --net host vimagick/registry-cli -r http://127.0.0.1:5000 -l user:pass'
# list all images
$ registry-cli
# cleanup old images
$ registry-cli -i image_name --delete-by-hours $((24*30)) --dry-run
```

View File

@ -97,6 +97,10 @@ $ curl -k -u username:password https://registry.easypi.pro:5000/v2/alpine/tags/l
> :warning: Docker will connect [insecure-registries][2] via HTTPS first (ignore TLS error), then try HTTP.
## Cleanup Outdated Images
- https://github.com/vimagick/dockerfiles/tree/master/registry-cli
## Read More
- https://github.com/docker/distribution/blob/master/docs/deploying.md

View File

@ -1,6 +1,8 @@
#
# See:
# - https://docs.docker.com/registry/configuration/
# - https://docs.docker.com/registry/storage-drivers/oss/
# - https://docs.docker.com/registry/garbage-collection/
# - https://github.com/Joxit/docker-registry-ui
#
@ -24,6 +26,7 @@ services:
- REGISTRY_STORAGE_OSS_SECURE=true
- REGISTRY_STORAGE_OSS_ROOTDIRECTORY=/registry/
- REGISTRY_STORAGE_DELETE_ENABLED=true
- REGISTRY_STORAGE_MAINTENANCE_READONLY_ENABLED=false
- REGISTRY_AUTH=htpasswd
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
- REGISTRY_AUTH_HTPASSWD_PATH=/etc/docker/registry/htpasswd