通过命令行查看harbor registry有多少个镜像的方法

获取token

curl -k -i -u admin:xxx https://example.com/service/token\?account\=admin\&service\=harbor-registry\&scope\=registry:catalog:\*
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 10 Oct 2018 07:51:48 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1166
Connection: keep-alive
Set-Cookie: beegosessionID=4709bb00355dee66bdbd158a0d90e6f7; Path=/; HttpOnly

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlNJQkc6TkRVVzpEN1BZOkMzUVo6MlUzUjpYV0ROOkhXVks6SVI1VzoySE9XOjZBSUE6QlVBQzoyWVBaIn0.eyJpc3MiOiJoYXJib3ItdG9rZW4taXNzdWVyIiwic3ViIjoiYWRtaW4iLCJhdWQiOiJoYXJib3ItcmVnaXN0cnkiLCJleHAiOjE1MzkxNTk3MDgsIm5iZiI6MTUzOTE1NzkwOCwiaWF0IjoxNTM5MTU3OTA4LCJqdGkiOiJVUnZ5dlhsTVVXQVZRNGVqIiwiYWNjZXNzIjpbeyJ0eXBlIjoicmVnaXN0cnkiLCJuYW1lIjoiY2F0YWxvZyIsImFjdGlvbnMiOlsiKiJdfV19.fqJBSpcDcPIVO5IySdsGHE4aMXi2xdmaNpnr2k46yaGDjgvCj1XYSwzu1A3voh97m1UDXzFgfjpbMOa3zgGDd71DvikRxFHMTm24i_IpPBO45QEfRiOo1gebjjZZl865uZCv7nHyz_NK_UKw5ppd3-Jntiqyca3pWR5FZfVtPnrqUyxjpSM3gYK5LfDJz_xSGn4OB_oM7YuxvyDqkTZ57S_qTeeLhrOIB0IHJCZsiXPVIPKBUt9wXU0Q1QUQqfMsmtBkb3AzHxRoHSdiEbBsdmR87KAJ0H3Erptoif3VBGHAZkb9GAcH9dYud_vM4w7ZKhOv-TdxvgpUiWMGnJHTvWQexxP4z93lV9OvQXwcT22BXiw0TVIeahfP6aSyjInmZZzTTJ4p-ED3nhriaY40QSSBZOdtwvDNNrZC38Li-g-Gg1_qXbivXK6wyleZHbASdtvIR1GQqH1w0hHPoPLa1CVfhJuILkRc9jw51ykooL_SfRRKUtTkxs4uON8zlGxukfD0ow6ntblei9u7Lw0EUfHeli9Udt32rGaSLXnxkZkEkN5OiR8O2spHqLNJlJWPEcVKNn69xR1MZfrQ4xvipYSebqshMFiiN_OnKjCq53HLAQjG6nvq1ObM_Q-CfD4Tyy4GGNpWDss1O-U3RFjMRZ86px5aXyi12j53C4jsnS8",
  "expires_in": 1800,
  "issued_at": "2018-10-10T07:51:48Z"
}

用返回的token获取镜像

curl -k -H "authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlNJQkc6TkRVVzpEN1BZOkMzUVo6MlUzUjpYV0ROOkhXVks6SVI1VzoySE9XOjZBSUE6QlVBQzoyWVBaIn0.eyJpc3MiOiJoYXJib3ItdG9rZW4taXNzdWVyIiwic3ViIjoiYWRtaW4iLCJhdWQiOiJoYXJib3ItcmVnaXN0cnkiLCJleHAiOjE1MzkxNTk3MDgsIm5iZiI6MTUzOTE1NzkwOCwiaWF0IjoxNTM5MTU3OTA4LCJqdGkiOiJVUnZ5dlhsTVVXQVZRNGVqIiwiYWNjZXNzIjpbeyJ0eXBlIjoicmVnaXN0cnkiLCJuYW1lIjoiY2F0YWxvZyIsImFjdGlvbnMiOlsiKiJdfV19.fqJBSpcDcPIVO5IySdsGHE4aMXi2xdmaNpnr2k46yaGDjgvCj1XYSwzu1A3voh97m1UDXzFgfjpbMOa3zgGDd71DvikRxFHMTm24i_IpPBO45QEfRiOo1gebjjZZl865uZCv7nHyz_NK_UKw5ppd3-Jntiqyca3pWR5FZfVtPnrqUyxjpSM3gYK5LfDJz_xSGn4OB_oM7YuxvyDqkTZ57S_qTeeLhrOIB0IHJCZsiXPVIPKBUt9wXU0Q1QUQqfMsmtBkb3AzHxRoHSdiEbBsdmR87KAJ0H3Erptoif3VBGHAZkb9GAcH9dYud_vM4w7ZKhOv-TdxvgpUiWMGnJHTvWQexxP4z93lV9OvQXwcT22BXiw0TVIeahfP6aSyjInmZZzTTJ4p-ED3nhriaY40QSSBZOdtwvDNNrZC38Li-g-Gg1_qXbivXK6wyleZHbASdtvIR1GQqH1w0hHPoPLa1CVfhJuILkRc9jw51ykooL_SfRRKUtTkxs4uON8zlGxukfD0ow6ntblei9u7Lw0EUfHeli9Udt32rGaSLXnxkZkEkN5OiR8O2spHqLNJlJWPEcVKNn69xR1MZfrQ4xvipYSebqshMFiiN_OnKjCq53HLAQjG6nvq1ObM_Q-CfD4Tyy4GGNpWDss1O-U3RFjMRZ86px5aXyi12j53C4jsnS8" https://example.com/v2/_catalog
{"repositories":["auto/autoserver","auto/zhang180125img","base-service/captcha-server","base-service/captcha-web","base-service/exporter-server","base-service/exporter-web","base-service/signature-web","bigdata/dep-centos7-kafka-2.11-0.10.1.1","bigdata/dep-centos7-zookeeper","calico/cni","calico/kube-policy-controller","calico/node","ceres/ceres-config-server","ceres/ceres-name-server","ceres/ceres-proxy-server","ceres/etcd","ceres/etcd-cluster","ceres/proxy-server","ceres/registry-server","ceres-dev/ceres-admin-api","ceres-dev/ceres-admin-ui-v2","ceres-dev/ceres-idp","ceres-dev/ceres-ldap-service","ceres-dev/ceres-mail-service","ceres-dev/ceres-mail-web","ceres-dev/ceres-sms-service","ceres-dev/ceres-sms-web","ceres-dev/ceres-store-all","ceres-dev/ceres-store-order","ceres-dev/ceres-store-product","ceres-dev/ceres-store-user","ceres-dev/ceres-store-web","ceres-dev/etcd-cluster","ceres-dev/gproxy","ceres-dev/node6-alpine-admin","ceres-dev/registry-server","ceres-dev/res","ceres-dev/rts","ceres-dev/signature-web","ceshi12312/centos-gcc","chenreg/centos","chenxy/tomcat","cicd-hub/beeblog-image-newgitlab","cicd-hub/beeblog-k8s-v11","cicd-hub/fn-gitlab-beeblog-image","cicd-hub/go-beeblog-image-newgitlab-1","cicd-hub/gogs-golang-k8sv11-golang","cicd-hub/golang-image-newgitlab-1","cicd-hub/image","cicd-hub/image-k8s17-2","cicd-hub/image-k8s17-dev","cicd-hub/image-load","cicd-hub/java-fanneng-image","cicd-hub/java-image-newgitlab","cicd-hub/java-k8sv11-image","cicd-hub/java-url-image-newgitlab","cicd-hub/java-url-image-newgitlab-1","cicd-hub/k8s-v11-image-test","cicd-hub/look","cicd-hub/master-dockerfile-1121","cicd-hub/new-image-180103","cicd-hub/new-k8s-v11-image","cicd-hub/post-server"]}

你可能感兴趣的:(harbor)