Docker Community Forums

Share and learn in the Docker community.

How to debug Private docker registry - "connection refused"


(Ginsul) #1

What is the suggested way to debug docker private registry?

I have tried both, http and https configurations. Both result in:

docker push localhost:5000/myfirstimage
The push refers to repository [localhost:5000/myfirstimage]
Get http://localhost:5000/v2/: dial tcp [::1]:5000: getsockopt: connection refused`

The registry outputs just a periodic debug message:

registry_1  | time="2018-04-27T16:22:09.435247529Z" level=debug msg="filesystem.Stat(\"/\")" 
go.version=go1.7.6 instance.id=018c6147-b169-4381-ad75-8b184317e712 service=registry 
trace.duration=342.953µs 
trace.file="/go/src/github.com/docker/distribution/registry/storage/driver/base/base.go" 
trace.func="github.com/docker/distribution/registry/storage/driver/base.(*Base).Stat" trace.id=59e8b015-a9ef- 
4ec6-aa44-273faa087f67 trace.line=137 version=v2.6.2

Otherwise I see it happily starting up:

registry_1  | time="2018-04-27T16:15:09.436655579Z" level=info msg="listening on [::]:5000, tls" 
go.version=go1.7.6 instance.id=018c6147-b169-4381-ad75-8b184317e712 service=registry version=v2.6.2

(Goffinf) #2

Start by providing a bit more information about how you configured and launched your registry, and what you have tried up to this point.

That error can be emitted for a number of reasons and not always the most obvious.

What authentication method have you configured ?

Have you set the insecure flag ?

If you are using TLS authentication have you completed the cert set up ?

Can you resolve localhost through dns (you might want to consider using a reverse proxy or even just add a host’s entry)

Help us to help you.


(Ginsul) #3

Thanks for your reply and apologies, I forgot to answer my own post - I have finally found the culprit.

As embarrassing as it may be, I have to admit, I was running docker-registry on minikube and instead of using minikube’s IP address I used localhost. Hence no logs in docker container.