Communicate with Docker daemon on Windows

1

I want to use Docker API on Windows, but as far as I know, there are no socket files on Windows. On Linux, I can use /var/run/docker.sock, but how can I use Docker API on Windows?

Malyutin Egor

Posted 2019-03-29T12:27:30.053

Reputation: 13

@Biswapriyo I want to use Docker API on Windows. But as far as I know, there is no socket files on Windows – Malyutin Egor – 2019-03-29T12:34:15.390

Answers

0

The Docker API is available through named pipes, Docker for Windows uses a named pipe npipe:////./pipe/docker_engine to access the REST API. You have to map the pipe to a tcp port.

You can solve this using socat:

socat TCP-LISTEN:PORT_NUMBER ,reuseaddr,fork PIPE:\\.\pipes\docker_engine

After running socat map, you can connect using tcp://localhost:PORT_NUMBER

You can find more information here

PD: Some docker functionalities depends on windows versions

Haroldo Payares Salgado

Posted 2019-03-29T12:27:30.053

Reputation: 326