Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could I list the images pushed to microk8s built-in registry

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?

like image 544
EduMelo Avatar asked May 19 '20 03:05

EduMelo


People also ask

How do I see photos in the container registry?

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.

Where are Docker registry images stored?

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.

How are Docker images stored in registry?

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.

Does Docker registry contain collection of images?

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.


Video Answer


3 Answers

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
like image 142
Arghya Sadhu Avatar answered Oct 22 '22 12:10

Arghya Sadhu


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

like image 26
EduMelo Avatar answered Oct 22 '22 11:10

EduMelo


Following REST APIs will do the job:

  1. 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.

  1. 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

like image 31
Satish Avatar answered Oct 22 '22 10:10

Satish