Docker Community Forums

Share and learn in the Docker community.

How to get the API-URL of a Docker 1.12 installation on Windows?

(Patrick Metz) #1

I recently installed Docker 1.12 on Windows 10 / Hyper-V and worked my way through the tutorials. Everything is running smoothly. I can push and pull images, etc…

But I can’t find a way to connect to its remote API. I need the API’s complete URL with port, so that I can use PhpStorm’s Docker management features.

How can I find this out?

(Michael Friis) #2

The URL is npipe:////./pipe/docker_engine, eg try:

docker -H npipe:////./pipe/docker_engine ps

(Patrick Metz) #3

Thanks a lot for your reply, but it does not seem to work this way. The command you gave me just gives me a quick stat overview of running containers, similar to the output of docker stats. Your command shows me for example that the container based on the nginx image has opened the ports 80/tcp and 443/tcp.

But I was under the impression that there is an remote API URL to which you can connect to via REST. That is the one I’m searching on my Windows machine.

(Michael Friis) #4

Yes, that REST API is running on npipe:////./pipe/docker_engine - it’s using HTTP over a Windows named pipe, similar to how the UNIX socket works on Linux / OS X.

(Patrick Metz) #5

Ah, ok. Sorry, I was confused, because PhpStorm does not accept npipe:// as URL scheme for Dockers REST API URL. I’m going to report this back to the developers of the IDE, so they can think of something.

Thanks a lot for your help!

(Michael Friis) #6

Sounds great, glad I could help.

If you don’t mind, if there’s a public link to the PHPStorm issue you create, please post it here for others to find.

(Patrick Metz) #7

Sure, why not.

This is the issue I created:
PhpStorm: Can’t connect to official Docker registry on Docker 1.12 / Windows 10

But it turned out to be a duplicate of this one:
PhpStorm: Plugin: Docker fails to connect via npipe:// on Windows

(Patrick Metz) #8

which in turn also relates to this one:
PhpStorm: Plugin: Docker fails to connect via unix:// on Mac OS X

(Patrick Metz) #9

Ha, I couldn’t just give up yet!

I found a way to map Dockers named Rest API pipe on Windows to a TCP port.
For everyone interested: look here.

(Liutas) #10

You can use tcp://localhost:2375