Enable docker search on private docker registry.

The cli interface works similar to other registry related commands:

  docker search foo

... searches for foo on the official hub

  docker search localhost:5000/foo

... does the same for the private reg at localhost:5000

Signed-off-by: Daniel Menet <membership@sontags.ch>
This commit is contained in:
Daniel Menet 2014-08-09 09:16:54 +02:00
parent 94ff3f3e4d
commit 744919be3d

View file

@ -82,6 +82,14 @@ func (s *Service) Search(job *engine.Job) engine.Status {
job.GetenvJson("authConfig", authConfig) job.GetenvJson("authConfig", authConfig)
job.GetenvJson("metaHeaders", metaHeaders) job.GetenvJson("metaHeaders", metaHeaders)
hostname, term, err := ResolveRepositoryName(term)
if err != nil {
return job.Error(err)
}
hostname, err = ExpandAndVerifyRegistryUrl(hostname)
if err != nil {
return job.Error(err)
}
r, err := NewSession(authConfig, HTTPRequestFactory(metaHeaders), IndexServerAddress(), true) r, err := NewSession(authConfig, HTTPRequestFactory(metaHeaders), IndexServerAddress(), true)
if err != nil { if err != nil {
return job.Error(err) return job.Error(err)