I would like to get the images and image ids of a number of docker images (over 100+). I can't pull all these images on my local machine to fetch the image ids. Is there a way using docker api or python gitlab api this would be possible to do? I was alternately thinking of using requests
to achieve this. Would really appreciate if anyone could share their insights on how to accomplish this.
# code so far
import docker
cli = docker.from_env()
cl_image = None
cli.login(username='<username>', password='<password>', registry='<registry-url-here>')
cl_image = cli.images.get('<enter registry url>/<image_name>:<image_tag>')
print(cl_image.id)
Unless I have the image pulled, I get an error: no such image
!
I see this useful link, https://docs.gitlab.com/ee/api/container_registry.html but unsure how to use this. Is this the way to go about obtaining the image details?
Thanks for the help.