How to enable docker remote API in Docker for Windows?

0 votes
I have docker for windows installed on my Windows10 machine. I want to access docker using the remote API through port 8080. I guess this port is not enabled by default. Do you have any idea how to open it?
Oct 15, 2018 in Docker by Sophie may
• 9,940 points
2,162 views

2 answers to this question.

0 votes

You can edit the configuration for docker daemon. Add a daemon.json file in the following path: %ProgramData%\docker\config

The file should contain something like this:

{ "hosts": ["tcp://0.0.0.0:8080"]
}

Then restart docker service.

answered Oct 15, 2018 by Tyrion anex
• 8,380 points
0 votes
Reviving a dead thread here, but the internet is lousy with this answer. This does not work on Windows 10 hosts. Neither does editing the hosts: value in any way that I've figured out, anywhere. Even in the \Docker\Docker\resources\windows-daemon-options.service file. Some suggestions, like this one, result in Docker failing to start altogether. Others (the .service edit) just result in no bueno.

The solution is to use netsh to portproxy (forward) the TCP port back to 127.0.0.1. Here is an example. Change YOUR_IP_HERE to be your LAN ip address. You can find your LAN ip address by running "ipconfig."

All of this is done from the Windows command prompt, elevated to admin. So, completely:

First, Click Start and type CMD.

Then, right click on Command Prompt and chose to Run As Administrator. Click Yes on the elevation request, and enter any required password.

Then, if needed, type ipconfig to find your LAN ip address. If you are confused at this point, then you're probably over your skis with Docker, anyway.... You are not done spelunking through google yet, my friend. See you in a half hour or so...

If you are this far, type this. replace "YOUR_LAN_IP" with your actual LAN IP:

netsh interface portproxy add v4tov4 listenport=2375 listenaddress=YOUR_LAN_IP connectport=2375 connectaddress=127.0.0.1

You of course need to make sure Windows Firewall is open on port 2375. Ta-da. Completely insecure but you've got it.
answered May 12 by fHF

edited May 12
Thanks. Your solution was the perfect one.

Related Questions In Docker

0 votes
1 answer

How to enable/ disable Hyper-V for Docker on Windows?

You can do this from command prompt ...READ MORE

answered Sep 10, 2018 in Docker by Tyrion anex
• 8,380 points
2,527 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to install telnet in Docker for Windows 10?

If you are trying to telnet in ...READ MORE

answered Aug 27, 2018 in Docker by Tyrion anex
• 8,380 points
1,162 views
0 votes
1 answer

How to save a Dynamic port in Docker for Windows?

The mapped ports can be accessed via ...READ MORE

answered Sep 4, 2018 in Docker by Tyrion anex
• 8,380 points
94 views