How to debug Private docker registry - "connection refused"

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 service=registry 
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 service=registry version=v2.6.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.

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.