Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

376
Views
docker for windows equivalent for "-v /var/run/docker.sock:/var/run/docker.sock"

I'm trying to control the host docker service from inside a container.

With Linux host and Linux container that is usually done like this: docker run -it -v /var/run/docker.sock:/var/run/docker.sock alpine

I now want to achieve the same with a Docker for Windows host and a Linux container.

If tried quite a lot of things, mostly using DOCKER_HOST with varying IP's like 10.75.0.1:2375 (IP of docker VM), 172.17.0.1:2375 (container IP) and 0.0.0.0:2375 as well as 192.168.178.xxx:2375 (host IP).

But apparently nothing responds on port 2375 or 2376 which I checked with something like: docker run -ti --rm alpine /bin/sh -c "apk add -U nmap && nmap -Pn 10.72.0.1 -p 2375-2376"

At this point I'd like to know if this is even possible with Docker for Windows. Most information I found concerns docker-machine / VirtualBox combinations.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

This works fine when running Linux containers using Docker for Windows too (but not when running Windows containers). Just ensure that your shell won't rewrite paths or similar.

over 4 years ago · Santiago Trujillo Report

0

I don't know how SO works so if necroposting is frowned upon then sorry. I also don't use docker on windows but this thread came up during my search for setting up portainer. I figured out the thing that I wanted to figure out and on first login portainer gave me this warning:

 Ensure that you have started the Portainer container with the following Docker flag:
-v "/var/run/docker.sock:/var/run/docker.sock" (Linux).
or
-v \\.\pipe\docker_engine:\\.\pipe\docker_engine (Windows).

So, there you go. Hope that helps.

over 4 years ago · Santiago Trujillo Report

0

To complement the answer by @friism:

Just ensure that your shell won't rewrite paths or similar.

This was happening to me within Git Bash on Windows. The solution, in this case, was to prefix all absolute paths with an extra slash (/) to disable the automatic path rewriting done by Git Bash. (Source)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!