Docker says: No connection could be made because the target machine actively refused it

Uchiha Itachi picture Uchiha Itachi · May 15, 2016 · Viewed 24.8k times · Source

I was using docker everyday but today a problem occurred without changing anything. I opened docker terminal and tried to start one of my containers. But it gave this error:"No connection could be made because the target machine actively refused it" I am using Windows 10.

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com


admin@samsung MINGW64 ~
$ docker ps
An error occurred trying to connect: Get http://127.0.0.1:2375/v1.22/containers/json: dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target machine actively refused it.

admin@samsung MINGW64 ~
$ docker version
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 22:37:33 2016
 OS/Arch:      windows/amd64
An error occurred trying to connect: Get http://127.0.0.1:2375/v1.22/version: dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target machine actively refused it.

Answer

Confidenc3 picture Confidenc3 · Mar 17, 2020
  1. Right-click on your PC
  2. Properties
  3. Advanced system settings
  4. Environment Variables
  5. Add new Variable: DOCKER_HOST
    Value: tcp://127.0.0.1:2375
  6. Run Docker Desktop
  7. bottom-right, right-click on Docker-Desktop
  8. Settings
  9. Enable the following option: "Expose daemon on tcp://localhost:2375 without TLS"