运行
docker run --rm -v /nfs1/docker/registry:/var/lib/registry registry:2.5.1 garbage-collect -d /root/registry/gc.yml
1.需要挂在你registry指定的rootdirectory
2.需要将gc.yml配置文件也挂载
gc.yml文件内容
version: 0.1 storage: filesystem: rootdirectory: /var/lib/registry