none
Connecting to the Docker Engine Running in Windows Server Core VM from Linux

    Question

  • I want to connect to the Docker Engine running in Windows Core VM from a Linux Box. I created a firewall rule to open port 2375. But when I set the Docker_HOST to the IP of my VM, I get the following error message. 

    Get http://172.16.1.164:2375/v1.20/images/json: dial tcp 172.16.1.164:2375: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..
    * Are you trying to connect to a TLS-enabled daemon without TLS?
    * Is your docker daemon up and running?

    I am assuming that the client is searching for the certificates since Docker Engine has enabled TLS mode. How do I configure the Docker client to talk to the Engine hosted in Windows Core VM?

    Thanks,

    Janakiram

    Tuesday, August 25, 2015 12:12 PM

Answers

  • Hi Janakiram,

    By default the Docker daemon only listens on this port for localhost connections.

    If you want to be able to remotely connect to it, you have to change the daemon startup command line.

    C:\ProgramData\docker\runDockerDaemon.cmd

    Change this line

    docker daemon -D -b "$global:SwitchName"

    to this line

    docker daemon -D -b "$global:SwitchName" -H 0.0.0.0:2375

    Please note that this lets the Docker daemon listen on all IP interfaces with an unsecured channel. So anybody who can reach your system could connect and use the Docker daemon.

    After you changed this line, restart the service, e.g. through PowerShell: Restart-Service docker

    Hope this helps,

    Lars


    This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.

    Tuesday, August 25, 2015 8:17 PM