How could I list the images pushed to microk8s built-in registry
I found that it's possible to list the registry images via HTTP GET in this address:http://<host_ip>:32000/v2/_catalog
It'll return the images in a json response
Use command microk8s ctr images list
. To know more use --help
microk8s ctr images --helpNAME: ctr images - manage imagesUSAGE: ctr images command [command options] [arguments...]COMMANDS: check check that an image has all content available locally export export an image import import images list, ls list images known to containerd pull pull an image from a remote push push an image to a remote remove, rm remove one or more images by reference label set and clear labels for an imageOPTIONS: --help, -h show help
Following REST APIs will do the job:
- Listing repositories:
http://host:32000/v2/_catalog?n=10
Last parameter n is the size of records to be returned. One can skip passing it but if you expect a long list then it's better to use pagination.
- Listing the images in the repository
http://host:32000/v2/repositoryName/tags/list?n=10
Note: Replace host and repositoryName accordingly.
For complete reference visit: https://docs.docker.com/registry/spec/api/#listing-repositories