How to query or obtain images in a private registry

How to query or obtain images in a private registry

Docker queries or obtains images in a private registry, using

docker search 192.168.1.8:5000

The command did not work after testing.

solve:

1. Get the image of the warehouse class:

[root@shanghai docker]# curl -XGET http://192.168.1.8:5000/v2/_catalog

{"repositories":["nginx"]}

2. Get the tag list of a certain image:

[root@shanghai docker]# curl -XGET http://192.168.1.8:5000/v2/image_name/tags/list

{"errors":[{"code":"NAME_UNKNOWN","message":"repositoryname not known toregistry","detail":{"name":"image_name"}}]}
[root@shanghai docker]# curl -XGET http://192.168.1.8:5000/v2/nginx/tags/list

{"name":"nginx","tags":["latest"]}

[root@shanghai docker]#

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

PS: View all tags of images in the Docker image repository

#!/bin/sh

repo_url=https://registry.hub.docker.com/v1/repositories
image_name=$1

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 image repository, then simply process the returned json result and print it out.

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

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Implementation of Docker private warehouse registry deployment
  • Implementation of Docker to build private warehouse (registry and Harbor)
  • Docker builds a private warehouse (registry, harbor)
  • The process of building a docker registry private warehouse

<<:  How to pull the docker image to view the version

>>:  Detailed steps to install MySql 5.7.21 in Linux

Recommend

Install centos7 virtual machine on win10

1. Download VMware Workstation 64 version https:/...

XHTML Getting Started Tutorial: XHTML Web Page Image Application

<br />Adding pictures reasonably can make a ...

jQuery implements breathing carousel

This article shares the specific code of jQuery t...

Summary of how to add root permissions to users in Linux

1. Add a user . First, use the adduser command to...

Detailed explanation of built-in methods of javascript array

Table of contents 1. Array.at() 2. Array.copyWith...

npm Taobao mirror modification explanation

1. Top-level usage 1. Install cnpm npm i -g cnpm ...

In-depth analysis of the role of HTML <!--...--> comment tags

When we check the source code of many websites, w...

Bootstrap 3.0 study notes grid system case

Preface In the previous article, we mainly learne...

Specific use of GNU Parallel

what is it? GNU Parallel is a shell tool for exec...

Operate on two columns of data as new columns in sql

As shown below: select a1,a2,a1+a2 a,a1*a2 b,a1*1...

JavaScript implements an input box component

This article example shares the specific code for...

A Brief Analysis of CSS Selector Grouping

Selector Grouping Suppose you want both the h2 el...

Tutorial on installing MYSQL5.7 from OEL7.6 source code

First, download the installation package from the...

MySQL 8.0.21.0 Community Edition Installation Tutorial (Detailed Illustrations)

1. Download MySQL Log in to the MySQL official we...

Mini Program to Implement Text Circular Scrolling Animation

This article shares the specific code of the appl...