I installed microk8s and I enabled registry addon I am able to push docker images to this registry and I am able to use this images in deployments.
But I'm trying to list images that was already pushed to this registry. How can I do that? Is there an API for that?
Sign in to the Azure portal. Select the Azure Container Registry to which you pushed the Nginx image. Select Repositories to see a list of the repositories that contain the images in the registry. Select a repository to see the image tags within that repository.
This is stored within /var/lib/docker on the docker host, probably under a container or overlay sub directory, and then under a unique directory name per container.
Docker Registry Using the docker push command, you can send your docker image to the Registry to be stored and saved. A Docker Image is stored within a Repository in the Docker Registry. Each Repository is unique for each user or account.
A registry is a storage and content delivery system, holding named Docker images, available in different tagged versions. Example: the image distribution/registry , with tags 2.0 and 2.1 . Users interact with a registry by using docker push and pull commands.
Use command microk8s ctr images list
. To know more use --help
microk8s ctr images --help
NAME:
ctr images - manage images
USAGE:
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 image
OPTIONS:
--help, -h show help
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
Following REST APIs will do the job:
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With