Search code examples
pythondockerpycharmdocker-for-windows

(Pycharm docker setting)Connection refused:no further information


I'm new to Docker. I get a connecting error when trying to setup Docker in PyCharm Professional edition.

I have followed this official manual and turn on the checkbox(Expose daemon on tcp://localhost:2375 without TLS) But it still not work.

problem picture

Cannot connect: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.O.O.1:2375 caused by: java.net.ConnectException: Connection refused: no further information

I have accidentally connected docker one time.But when i restart my computer i cannot connect docker anymore.

Any further help would be gratefully appreciated.


Solution

  • If you are facing connection refused then there may be a chance that there is no server to respond to your request.

    So first check whether docker server is listening on 2375 port.

    netstat -anp tcp | findstr 2375
    

    Or, use tcpview for GUI.

    If docker is not listening on this port, then check your C:\ProgramData\Docker\config\daemon.json file and verify whether you have the below Key value pair in your JSON.

    "hosts": ["tcp://0.0.0.0:2375"]
    

    If it is not there, then add this and restart your docker daemon.

    If you are behind a proxy, then make sure to add this in no-proxy, so that your requests will not be routed via a proxy server.

    NOTE: I don't have any experience with docker on windows