Bootstrap FreeKB - Docker - display images in a private registry using REST API
Docker - display images in a private registry using REST API

Updated:   |  Docker articles

This assumes you have installed Docker on Linux and Docker is running and that you have created your own private registry.

A Docker image contains the code used to create a Docker container, such as creating a Nginx web server, or a mySQL server, or a home grown app, and the list goes on. In this way, an image is like a template used to create a container. An image is kind of like a virtual machine, but much more light weight, using significantly less storage a memory (containers are usually megabytes in size).

 

Let's say you've created a private registry on a Docker server with hostname docker.example.com and you've configured your private registry to listen on port 5000. In this example, the following curl command (on Linux) can be use to list the images in your private registry. In this example, there is a single image in the private registry, nginx.

~]# curl --insecure --request GET --user john.doe:itsasecret --url https://docker.example.com:5000/v2/_catalog
{
  "repositories": [
    "nginx"
  ]
}

 

And here is how to include the tags.

~]# curl --insecure --request GET --user john.doe:itsasecret --url https://docker.example.com:5000/v2/nginx/tags/list 
{
  "name": "nginx",
  "tags": [
    "latest"
  ]
}

 

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 2590f1 in the box below so that we can be sure you are a human.