Managed to get the mortensrasmussen clean up method to work:
1 - Disable authentication by editing common/config/registry/config.yml. Comment out
following section with hash.
auth:
token:
issuer: harbor-token-issuer
https://docker.iotechsys.com/service/token
rootcertbundle: /etc/registry/root.crt
service: harbor-registry
2 - Edit docker-compose.yml file to expose registry port:
registry:
ports:
- 127.0.0.1:5000:5000
3 - Stop and restart harbor for changes to take effect
4 - Run cleanup to remove unused manifests
docker run --network="host" -it -v /data/registry:/registry -e REGISTRY_URL=http://127.0.0.1:5000 mortensrasmussen/docker-registry-manifest-cleanup
** 注意替换 /data/registry 文件夹内容 **
5 - Run normal cleanup to remove blobs now no longer associated with a manifest
docker run -it --name gc --rm --volumes-from registry vmware/registry-photon:v2.6.2-v1.4.0 garbage-collect /etc/registry/config.yml
6 - Back out config/compose file changes and restart harbor
网友评论