How to use Remote API with Windows Container? RRS feed

  • Question

  • Hi all,

    Currently, I'm working with Docker Container on 2016 TP, everything is great and now I can deploy my application to Containers for test.

    However, I must working remotely with these containers, hence, I want to enable Remote API on Docker, I searched for a day but didn't see any thing relate to this yet.

    So, does anyone know about this? Can you help me?

    Monday, June 20, 2016 7:02 AM

All replies

  • By remote you mean PowerShell Enter-PSSession? That should work, since WinRM service can be run within container and you just need to do proper port binding and open firewall on the host for WinRM ports. I don't have step by step guide but I don't know of anything is stopping this.
    Monday, June 20, 2016 11:36 AM
  • Here is a document on configuring the Docker daemon on Windows - Docker Daemon on Windows .

    By default the Docker daemon on listens to internal requests over a named pipe. To configured incoming requests over TCP do the following:

    • Create a file 'c:\programdata\dokcer\config\daemon.json'
    • Set the hosts flag in this file. 
    • Restart the Docker service.

    Sample configurations:

    Secure - certificates will need to be in place (documentation).

        "hosts": ["tcp://", "npipe://"],
        "tlsverify": true,
        "tlscacert": "C:\\ProgramData\\docker\\certs.d\\ca.pem",
        "tlscert": "C:\\ProgramData\\docker\\certs.d\\server-cert.pem",
        "tlskey": "C:\\ProgramData\\docker\\certs.d\\server-key.pem",

    Insecure - really insecure, not recommended outside of isolated test:

        "hosts": ["tcp://"]

    Once these are set, the Docker daemon can be accessed from a remote system like this:

    docker -H tcp:// images

    To remove -H parameter an environment variable can be set 'DOCKER_HOST'.

    Hope this helps.


    Monday, June 20, 2016 5:14 PM