2

Is it possible to start a native windows sibling container from within a native windows container? So I don't mean docker-in-docker.

Like on linux:

docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Community
  • 1
  • 1
mawl
  • 51
  • 5

1 Answers1

2

UPDATE: The latest Docker EE preview releases for Windows support bind-mounting the Docker API. Details here: https://blog.docker.com/2017/09/docker-windows-server-1709/

Yeah, there's a couple of steps though and it's not very elegant nor secure. You have to change the Windows Daemon config to listen on a public interface:

net stop docker
dockerd.exe --unregister-service
dockerd.exe -H npipe:////./pipe/docker_engine -H 0.0.0.0:2375 --register-service
net start docker

Now when starting containers, the Docker API will be available on the default gateway ip (you can find it with ipconfig) of the container, on port 2375.

friism
  • 19,068
  • 5
  • 80
  • 116
  • Can you provide some examples of this? This seems like a pretty important scenario not documented online yet. – deepelement Jan 16 '18 at 15:56
  • @deepelement in the latest previews, you can now mount Docker daemon named pipe too: https://blog.docker.com/2017/09/docker-windows-server-1709/ – friism Jan 18 '18 at 18:32
  • Looks like docker blog urls have changed... this is the updated link https://www.docker.com/blog/docker-windows-server-1709/ – Dutchmanjonny May 25 '22 at 14:39