2

I'm working with docker HUB as well as a couple private docker repos. I'm trying to find the syntax to use for running docker search for the alternate docker repositories.

For example, to search for ubuntu images in my private repo I tried:

docker search https://my.docker.repo   ubuntu

But I get an error saying "docker search" requires exactly 1 argument.

I've looked at the docker search documentation: https://docs.docker.com/engine/reference/commandline/search/ and it doesn't show any way to specify an alternate docker repository.

I did a search on StackOverflow and found:

A google search gave this answer:

which says you can use a curl command like this:

curl -X GET https://my.docker.repo/v1/search?q=postgresql

But this just returned an HTML page. If I went to that same URL in my browser, I got a page that redirected me to the docker UI for that repo.

I'm guessing based on what I've found that this isn't possible. If it is please let me know. Thanks.

PatS
  • 8,833
  • 12
  • 57
  • 100

1 Answers1

4

Note: your private registry must support the search api endpoint else you will get a 404 error (try against the docker.elastic.co registry for a non functionnal example).

Basically:

docker search <registry fqdn>/<search term>

<registry fqdn> above is strictly the fqdn (i.e. without the http(s):// scheme, as in the image names used for push/pulls)

Practical example:

$ docker search quay.io/node
NAME                                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
calico/node                                                                                       0                    
prometheus/node-exporter                          # Node exporter [![Build Status](https://tra…   0                    
k8scsi/csi-node-driver-registrar                                                                  0                    
gambol99/node-authorizer                                                                          0                    
openebs/node-disk-manager-amd64                   Kubernetes Storage Device Management.   Sour…   0                    
openebs/node-disk-operator-amd64                  Operator for managing the Storage Devices an…   0                    
openshift/origin-node                                                                             0                    
kubernetes_incubator/node-feature-discovery       Enabling node-feature-discovery in Kubernete…   0                    
openshift/origin-node-feature-discovery                                                           0                    
kubevirt/node-maintenance-operator                                                                0                    
bitnami/node-exporter                             Official build of [Bitnami node-exporter](ht…   0                    
openshift/origin-node-problem-detector                                                            0                    
opencloudio/node-exporter                                                                         0                    
eclipse/che-sidecar-node                          Node sidecar container for plug-in tooling  …   0                    
giantswarm/node-exporter                                                                          0                    
rebuy/node-drainer                                                                                0                    
giantswarm/node                                                                                   0                    
openshift/origin-cluster-node-tuned                                                               0                    
sysdig/node-image-analyzer                                                                        0                    
openshift/origin-prometheus-node-exporter                                                         0                    
openshift/origin-node-problem-detector-operator                                                   0                    
openshift/origin-csi-node-driver-registrar                                                        0                    
openshift/origin-cluster-node-tuning-operator                                                     0                    
mhart/alpine-node                                                                                 0                    
skygeario/skygear-node                                                                            0
Zeitounator
  • 38,476
  • 7
  • 53
  • 66
  • 1
    Worked like a charm with one of my repos, but failed with the other. But you answered that as well when you said `your private registry must support the search api endpoint`. – PatS Mar 15 '21 at 23:02