Method of Docker Query or Obtain Mirror in Private Warehouse


Doker queries or retrieves mirrors in a private repository, using

docker search

Commands are not well tested.


1. Get the mirror image of the warehouse class:

[[email protected] docker]# curl -XGEThttp://


2. Get a list of labels for a mirror:

[[email protected] docker]# curl -XGEThttp://

{"errors":[{"code":"NAME_UNKNOWN","message":"repositoryname not known toregistry","detail":{"name":"image_name"}}]}

[[email protected] docker]# curl -XGEThttp://


[[email protected] docker]#


PS: View all the labels of the mirrors in the Docker Mirror Warehouse



curl -s ${repo_url}/${image_name}/tags | json_reformat | grep name | awk '{print $2}' | sed -e 's/"//g'

In fact, the implementation method is to query through the restful API of the mirror warehouse, then simply process the returned JSON results, and print them out.

The implementation of the above script is to query only from hub. docker. com. If you use other warehouses, you can modify the URL of the warehouse as needed.

The above is the whole content of this article. I hope it will be helpful to everyone’s study, and I hope you will support developpaer more.

Recommended Today

Laravel returns the unified format error code

background Recently, I was learning to develop an Android project. The back-end interface project started a new project with PHP’s yii2.0 framework, and then changed to laravel 5.5. Recently, I saw that laravel upgraded the new version, so I updated the project to laravel 6.4In the process of using Yii and laravel, both frameworks are […]