diff --git a/registry-cli/README.md b/registry-cli/README.md index 3b9618a..881af22 100644 --- a/registry-cli/README.md +++ b/registry-cli/README.md @@ -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 ``` diff --git a/registry/README.md b/registry/README.md index 88d9f63..9f770c7 100644 --- a/registry/README.md +++ b/registry/README.md @@ -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 diff --git a/registry/docker-compose.oss.yml b/registry/docker-compose.oss.yml index d731c53..7e1b742 100644 --- a/registry/docker-compose.oss.yml +++ b/registry/docker-compose.oss.yml @@ -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