Bind to docker socket on Windows












30















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.










share|improve this question


















  • 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
















30















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.










share|improve this question


















  • 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














30












30








30


9






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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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














  • 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












4 Answers
4






active

oldest

votes


















46














For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock






share|improve this answer
























  • 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



















13














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) or C: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





share|improve this answer



















  • 1





    Very good explanation!

    – Andrei
    Dec 11 '16 at 16:46



















2














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






share|improve this answer

































    0














    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





    share|improve this answer

























      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      46














      For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock






      share|improve this answer
























      • 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
















      46














      For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock






      share|improve this answer
























      • 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














      46












      46








      46







      For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock






      share|improve this answer













      For Docker for Windows following seems to be working: -v //var/run/docker.sock:/var/run/docker.sock







      share|improve this answer












      share|improve this answer



      share|improve this answer










      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



















      • 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













      13














      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) or C: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





      share|improve this answer



















      • 1





        Very good explanation!

        – Andrei
        Dec 11 '16 at 16:46
















      13














      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) or C: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





      share|improve this answer



















      • 1





        Very good explanation!

        – Andrei
        Dec 11 '16 at 16:46














      13












      13








      13







      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) or C: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





      share|improve this answer













      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) or C: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






      share|improve this answer












      share|improve this answer



      share|improve this answer










      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














      • 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











      2














      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






      share|improve this answer






























        2














        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






        share|improve this answer




























          2












          2








          2







          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






          share|improve this answer















          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







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 18 '18 at 3:20

























          answered Oct 18 '18 at 3:10









          Sean WSean W

          30328




          30328























              0














              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





              share|improve this answer






























                0














                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





                share|improve this answer




























                  0












                  0








                  0







                  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





                  share|improve this answer















                  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






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 21 '18 at 16:03

























                  answered Nov 21 '18 at 15:50









                  jackstrappjackstrapp

                  15510




                  15510






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      MongoDB - Not Authorized To Execute Command

                      How to fix TextFormField cause rebuild widget in Flutter

                      Npm cannot find a required file even through it is in the searched directory