docker A way to query or get an image in the private repository of registry

  • 2021-01-22 08:20:24
  • OfStack

docker queries or gets an image in a private repository (registry), using

docker search

The command did not test well.


Get the repository class mirroring:

[root@shanghai docker]# curl -XGEThttp://


Get a list of tags from an image:

[root@shanghai docker]# curl -XGEThttp://

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

[root@shanghai docker]# curl -XGEThttp://


[root@shanghai docker]#

Reference: https: / / stackoverflow com/questions / 23733678 / how - to - search images - from private - 1-0 - registry in -- docker

PS: View all labels for images in the Docker mirror repository



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 mirror the warehouse restful API, to query, and then return json results simple processing 1, and then print out.

The implementation of the above script is to query from only. If you are using another repository, you can modify the repository's url as needed.

Related articles: