Bind to docker socket on Windows
On *nix systems, it is possible to bind-mount the docker socket from the host machine to the VM by doing something like this:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Is there an equivalent way to do this when running docker on a windows host?
I tried various combinations like:
docker run -v tcp://127.0.0.1:2376:/var/run/docker.sock ...
docker run -v "tcp://127.0.0.1:2376":/var/run/docker.sock ...
docker run -v localhost:2376:/var/run/docker.sock ...
none of these have worked.
docker
add a comment |
On *nix systems, it is possible to bind-mount the docker socket from the host machine to the VM by doing something like this:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Is there an equivalent way to do this when running docker on a windows host?
I tried various combinations like:
docker run -v tcp://127.0.0.1:2376:/var/run/docker.sock ...
docker run -v "tcp://127.0.0.1:2376":/var/run/docker.sock ...
docker run -v localhost:2376:/var/run/docker.sock ...
none of these have worked.
docker
1
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10
add a comment |
On *nix systems, it is possible to bind-mount the docker socket from the host machine to the VM by doing something like this:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Is there an equivalent way to do this when running docker on a windows host?
I tried various combinations like:
docker run -v tcp://127.0.0.1:2376:/var/run/docker.sock ...
docker run -v "tcp://127.0.0.1:2376":/var/run/docker.sock ...
docker run -v localhost:2376:/var/run/docker.sock ...
none of these have worked.
docker
On *nix systems, it is possible to bind-mount the docker socket from the host machine to the VM by doing something like this:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Is there an equivalent way to do this when running docker on a windows host?
I tried various combinations like:
docker run -v tcp://127.0.0.1:2376:/var/run/docker.sock ...
docker run -v "tcp://127.0.0.1:2376":/var/run/docker.sock ...
docker run -v localhost:2376:/var/run/docker.sock ...
none of these have worked.
docker
docker
asked Apr 21 '16 at 9:18
TheolodusTheolodus
72411323
72411323
1
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10
add a comment |
1
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10
1
1
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10
add a comment |
4 Answers
4
active
oldest
votes
For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error:docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.
– Josh Wittner
May 4 '17 at 20:45
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
|
show 8 more comments
As the Docker documentation states:
If you are using Docker Machine on Mac or Windows, your Engine daemon
has only limited access to your OS X or Windows filesystem. Docker
Machine tries to auto-share your/Users
(OS X) orC:Users
(Windows)
directory. So, you can mount files or directories on OS X using:
docker run -v /Users/<path>:/<container path> ...
On Windows, mount directories using:
docker run -v /c/Users/<path>:/<container path> ...
All other paths come from your virtual machine’s filesystem, so if you
want to make some other host folder available for sharing, you need to
do additional work. In the case of VirtualBox you need to make the
host folder available as a shared folder in VirtualBox. Then, you can
mount it using the Docker -v flag.
With all that being said, you can still use the:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
The first /var/run/docker.sock
refers to the same path in your boot2docker
virtual machine.
For example, when I run my own Jenkins image using the following command in a Windows machine:
$ docker run -dP -v /var/run/docker.sock:/var/run/docker.sock alidehghanig/jenkins
I can still talk to the Docker Daemon in the host machine using the typical docker
commands. For example, when I run docker ps
in the Jenkins container, I can see running containers in the host machine:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65311731f446 jen... "/bi.." 10... Up 10.. 0.0.0.0:.. jenkins
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
add a comment |
Just to top it off on the answers provided earlier
When using docker-compose, one must set the COMPOSE_CONVERT_WINDOWS_PATHS=1
by either:
1) create a .env
file at the same location as the project's docker-compose.yml file
2) in the CLI set COMPOSE_CONVERT_WINDOWS_PATHS=1
before running the docker-compose up command.
source
add a comment |
I never made it worked myself, but i know it works on windows container on docker for windows server 2016 using this technique:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option
We actually have at the shop vsts-agents on windows containers that uses the host docker like that:
# listen using the default unix socket, and on 2 specific IP addresses on this host.
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
# then you can execute remote docker commands (from container to host for example)
$ docker -H tcp://0.0.0.0:2375 ps
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36765138%2fbind-to-docker-socket-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error:docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.
– Josh Wittner
May 4 '17 at 20:45
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
|
show 8 more comments
For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error:docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.
– Josh Wittner
May 4 '17 at 20:45
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
|
show 8 more comments
For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock
For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock
answered Dec 6 '16 at 21:12


Alexander ChicheninAlexander Chichenin
46144
46144
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error:docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.
– Josh Wittner
May 4 '17 at 20:45
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
|
show 8 more comments
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error:docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.
– Josh Wittner
May 4 '17 at 20:45
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
This really works!! I have been trying to get this working forever. Thanks a lot!
– potibas
Jan 11 '17 at 1:53
8
8
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:
docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error: docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.– Josh Wittner
May 4 '17 at 20:45
Some of the above answers seem like they aren't referring to running Windows containers on Docker for Windows. When I try to run the standard command for doing this:
docker run -v /var/run/docker.sock:/var/run/docker.sock
I get the following error: docker: Error response from daemon: invalid bind mount spec "//var/run/docker.sock:/var/run/docker.sock": invalid volume specification: '\varrundocker.sock:varrundocker.sock'
The error makes sense because as I'm on Windows, trying to run a Windows container the paths don't make sense.– Josh Wittner
May 4 '17 at 20:45
1
1
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
@JoshWittner: have you found a solution to make the Docker Socket available inside Windows Containers with Windows Hosts?
– Martin
May 17 '17 at 11:24
1
1
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
After 2 days of googling, I finally found the answer!
– Utwo
Mar 26 '18 at 10:58
3
3
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
Anyone know is there's a "2018" solution for this (Since Docker on Windows no longer uses a VM to run Windows containers?)
– Mike Christensen
Sep 19 '18 at 17:58
|
show 8 more comments
As the Docker documentation states:
If you are using Docker Machine on Mac or Windows, your Engine daemon
has only limited access to your OS X or Windows filesystem. Docker
Machine tries to auto-share your/Users
(OS X) orC:Users
(Windows)
directory. So, you can mount files or directories on OS X using:
docker run -v /Users/<path>:/<container path> ...
On Windows, mount directories using:
docker run -v /c/Users/<path>:/<container path> ...
All other paths come from your virtual machine’s filesystem, so if you
want to make some other host folder available for sharing, you need to
do additional work. In the case of VirtualBox you need to make the
host folder available as a shared folder in VirtualBox. Then, you can
mount it using the Docker -v flag.
With all that being said, you can still use the:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
The first /var/run/docker.sock
refers to the same path in your boot2docker
virtual machine.
For example, when I run my own Jenkins image using the following command in a Windows machine:
$ docker run -dP -v /var/run/docker.sock:/var/run/docker.sock alidehghanig/jenkins
I can still talk to the Docker Daemon in the host machine using the typical docker
commands. For example, when I run docker ps
in the Jenkins container, I can see running containers in the host machine:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65311731f446 jen... "/bi.." 10... Up 10.. 0.0.0.0:.. jenkins
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
add a comment |
As the Docker documentation states:
If you are using Docker Machine on Mac or Windows, your Engine daemon
has only limited access to your OS X or Windows filesystem. Docker
Machine tries to auto-share your/Users
(OS X) orC:Users
(Windows)
directory. So, you can mount files or directories on OS X using:
docker run -v /Users/<path>:/<container path> ...
On Windows, mount directories using:
docker run -v /c/Users/<path>:/<container path> ...
All other paths come from your virtual machine’s filesystem, so if you
want to make some other host folder available for sharing, you need to
do additional work. In the case of VirtualBox you need to make the
host folder available as a shared folder in VirtualBox. Then, you can
mount it using the Docker -v flag.
With all that being said, you can still use the:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
The first /var/run/docker.sock
refers to the same path in your boot2docker
virtual machine.
For example, when I run my own Jenkins image using the following command in a Windows machine:
$ docker run -dP -v /var/run/docker.sock:/var/run/docker.sock alidehghanig/jenkins
I can still talk to the Docker Daemon in the host machine using the typical docker
commands. For example, when I run docker ps
in the Jenkins container, I can see running containers in the host machine:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65311731f446 jen... "/bi.." 10... Up 10.. 0.0.0.0:.. jenkins
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
add a comment |
As the Docker documentation states:
If you are using Docker Machine on Mac or Windows, your Engine daemon
has only limited access to your OS X or Windows filesystem. Docker
Machine tries to auto-share your/Users
(OS X) orC:Users
(Windows)
directory. So, you can mount files or directories on OS X using:
docker run -v /Users/<path>:/<container path> ...
On Windows, mount directories using:
docker run -v /c/Users/<path>:/<container path> ...
All other paths come from your virtual machine’s filesystem, so if you
want to make some other host folder available for sharing, you need to
do additional work. In the case of VirtualBox you need to make the
host folder available as a shared folder in VirtualBox. Then, you can
mount it using the Docker -v flag.
With all that being said, you can still use the:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
The first /var/run/docker.sock
refers to the same path in your boot2docker
virtual machine.
For example, when I run my own Jenkins image using the following command in a Windows machine:
$ docker run -dP -v /var/run/docker.sock:/var/run/docker.sock alidehghanig/jenkins
I can still talk to the Docker Daemon in the host machine using the typical docker
commands. For example, when I run docker ps
in the Jenkins container, I can see running containers in the host machine:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65311731f446 jen... "/bi.." 10... Up 10.. 0.0.0.0:.. jenkins
As the Docker documentation states:
If you are using Docker Machine on Mac or Windows, your Engine daemon
has only limited access to your OS X or Windows filesystem. Docker
Machine tries to auto-share your/Users
(OS X) orC:Users
(Windows)
directory. So, you can mount files or directories on OS X using:
docker run -v /Users/<path>:/<container path> ...
On Windows, mount directories using:
docker run -v /c/Users/<path>:/<container path> ...
All other paths come from your virtual machine’s filesystem, so if you
want to make some other host folder available for sharing, you need to
do additional work. In the case of VirtualBox you need to make the
host folder available as a shared folder in VirtualBox. Then, you can
mount it using the Docker -v flag.
With all that being said, you can still use the:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
The first /var/run/docker.sock
refers to the same path in your boot2docker
virtual machine.
For example, when I run my own Jenkins image using the following command in a Windows machine:
$ docker run -dP -v /var/run/docker.sock:/var/run/docker.sock alidehghanig/jenkins
I can still talk to the Docker Daemon in the host machine using the typical docker
commands. For example, when I run docker ps
in the Jenkins container, I can see running containers in the host machine:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65311731f446 jen... "/bi.." 10... Up 10.. 0.0.0.0:.. jenkins
answered Jun 24 '16 at 21:28


Ali DehghaniAli Dehghani
26.2k987103
26.2k987103
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
add a comment |
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
1
1
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
Very good explanation!
– Andrei
Dec 11 '16 at 16:46
add a comment |
Just to top it off on the answers provided earlier
When using docker-compose, one must set the COMPOSE_CONVERT_WINDOWS_PATHS=1
by either:
1) create a .env
file at the same location as the project's docker-compose.yml file
2) in the CLI set COMPOSE_CONVERT_WINDOWS_PATHS=1
before running the docker-compose up command.
source
add a comment |
Just to top it off on the answers provided earlier
When using docker-compose, one must set the COMPOSE_CONVERT_WINDOWS_PATHS=1
by either:
1) create a .env
file at the same location as the project's docker-compose.yml file
2) in the CLI set COMPOSE_CONVERT_WINDOWS_PATHS=1
before running the docker-compose up command.
source
add a comment |
Just to top it off on the answers provided earlier
When using docker-compose, one must set the COMPOSE_CONVERT_WINDOWS_PATHS=1
by either:
1) create a .env
file at the same location as the project's docker-compose.yml file
2) in the CLI set COMPOSE_CONVERT_WINDOWS_PATHS=1
before running the docker-compose up command.
source
Just to top it off on the answers provided earlier
When using docker-compose, one must set the COMPOSE_CONVERT_WINDOWS_PATHS=1
by either:
1) create a .env
file at the same location as the project's docker-compose.yml file
2) in the CLI set COMPOSE_CONVERT_WINDOWS_PATHS=1
before running the docker-compose up command.
source
edited Oct 18 '18 at 3:20
answered Oct 18 '18 at 3:10
Sean WSean W
30328
30328
add a comment |
add a comment |
I never made it worked myself, but i know it works on windows container on docker for windows server 2016 using this technique:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option
We actually have at the shop vsts-agents on windows containers that uses the host docker like that:
# listen using the default unix socket, and on 2 specific IP addresses on this host.
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
# then you can execute remote docker commands (from container to host for example)
$ docker -H tcp://0.0.0.0:2375 ps
add a comment |
I never made it worked myself, but i know it works on windows container on docker for windows server 2016 using this technique:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option
We actually have at the shop vsts-agents on windows containers that uses the host docker like that:
# listen using the default unix socket, and on 2 specific IP addresses on this host.
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
# then you can execute remote docker commands (from container to host for example)
$ docker -H tcp://0.0.0.0:2375 ps
add a comment |
I never made it worked myself, but i know it works on windows container on docker for windows server 2016 using this technique:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option
We actually have at the shop vsts-agents on windows containers that uses the host docker like that:
# listen using the default unix socket, and on 2 specific IP addresses on this host.
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
# then you can execute remote docker commands (from container to host for example)
$ docker -H tcp://0.0.0.0:2375 ps
I never made it worked myself, but i know it works on windows container on docker for windows server 2016 using this technique:
https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-socket-option
We actually have at the shop vsts-agents on windows containers that uses the host docker like that:
# listen using the default unix socket, and on 2 specific IP addresses on this host.
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
# then you can execute remote docker commands (from container to host for example)
$ docker -H tcp://0.0.0.0:2375 ps
edited Nov 21 '18 at 16:03
answered Nov 21 '18 at 15:50
jackstrappjackstrapp
15510
15510
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36765138%2fbind-to-docker-socket-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
On Windows docker runs inside a VirtualBox VM, so it wouldn't be able to bind network resources from your Windows.
– Xiongbing Jin
Apr 21 '16 at 14:10