JIYIK CN >

Current Location:Home > Learning > OPERATING SYSTEM > Docker >

List all images in Docker Registry V2

Author:JIYIK Last Updated:2025/03/24 Views:

After several iterations, Docker Registry was upgraded from version 1 to version 2. Especially being new, some commands needed to be included or adequately documented on its official documentation website.

An example is getting a list of images in a Docker Registry.

This article will discuss getting the image list in Docker Registry V2.


Get the full list of images on Docker Registry V2

Before we begin, pull the latest version of Docker Registry in DockerHub by running the following command.

$ docker pull distribution/registry:master

In Docker Registry version 1, we could get a list of all images by performing an API GET call to the base URL of http://myregistry:5000/v1/search? Although not implied in the documentation, we can also perform a similar approach to update and different base URL by calling a GET request.


List all repositories and mirrors

When Docker updated the Docker Registry to version 2, they also updated all the API base URLs. So now, instead of calling the v1 base URL, we can use the following URL.

$ curl -X GET https://myregistry:5000/v2/_catalog

The default results only show one hundred (100) mirror records, but if you need to show more, you can paginate the results by appending query parameters.

$ curl -X GET https://myregistry:5000/v2/_catalog?n=<count>

List all tags for a repository

If we need to list all the tags of a repository, we can use the following different endpoints.

$ curl -X GET https://myregistry:5000/v2/<name>/tags/list

We can replace the name value with the name of the repository we want to query tags from.


Querying the API using credentials

If the registry requires authentication, we must specify our credentials in the curl command by adding the -u flag.

$ curl -X GET -u <username>:<password> https://myregistry:5000/v2/_catalog
$ curl -X GET -u <username>:<password> https://myregistry:5000/v2/<name>/tags/list

If our registry used a self-signed certificate instead of credentials, we could make an insecure request by adding the -k and --insecure flags. However, this is considered a security risk, so use it at your own risk.

The Docker Registry v2 API provides more endpoints to satisfy more requests. We can find the complete endpoints in this link.

For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.

Article URL:

Related Articles

Executing multiple commands in Docker-Compose

Publish Date:2025/03/24 Views:151 Category:Docker

Docker makes it easier for developers to build, test, and deploy applications without worrying about dependencies by packaging them in standardized units called containers. Docker-compose is an advanced, must-have tool for managing multi-co

View logs for a specific Docker Compose service

Publish Date:2025/03/24 Views:60 Category:Docker

When using docker-compose up, we can see the logs of all containers in the YAML file; however, if we specify a specific container service, the output will not show any service dependencies in the log. Therefore, this article will explore ho

Differences between Docker and Docker Compose

Publish Date:2025/03/24 Views:146 Category:Docker

Both docker and docker compose docker run Docker containers. The two Docker constructs are comparable, but that's about it. This article will discuss docker compose the main differences between docker and . Differences between Docker and Do

Recreate the container from the new image using Docker-Compose

Publish Date:2025/03/24 Views:178 Category:Docker

As we develop our applications, we often make changes or add more features to make the application more effective for the different users who interact with the application. When using Docker, we need to ensure that the changes or features w

Exposing multiple ports in a Docker container

Publish Date:2025/03/24 Views:186 Category:Docker

There are different types of communication on the Internet, the most common ones include file transfers, sending emails, and serving web pages. To make this communication possible, we make use of port numbers that help identify the type of

Using Docker network host commands

Publish Date:2025/03/24 Views:51 Category:Docker

Docker containers work by leveraging network drivers that are created during the installation of Docker. The default drivers available to us include bridge and host networking. When we create containers without specifying a network, they ar

Clear Docker container logs

Publish Date:2025/03/24 Views:192 Category:Docker

Logs are information recorded by the application when a specific event or state occurs. They help us monitor the application and take necessary actions. For example, when we deploy an application to a production environment, logs can help u

Docker daemon log location

Publish Date:2025/03/24 Views:65 Category:Docker

The Docker daemon provides essential information about the general state of your microservices architecture. Unfortunately, container-centric logging techniques allow you to collect relevant data from your services but provide little inform

Difference between COPY and ADD commands in Dockerfile

Publish Date:2025/03/24 Views:140 Category:Docker

A Dockerfile is a text document that contains all the commands used to build a Docker image. Recently, we have seen Docker being widely used as the default tool for managing configurations and automating deployments. Advanced features such

Scan to Read All Tech Tutorials

Social Media
  • https://www.github.com/onmpw
  • qq:1244347461

Recommended

Tags

Scan the Code
Easier Access Tutorial