Search code examples
macosdockerdocker-machine

How to "Enable expose daemon on tcp://localhost:2375 without TLS" on mac


I want to know how to check if I enabled to expose daemon on tcp and if don't how to enable it


Solution

  • On Linux, you need to configure the file: /etc/docker/daemon.json

    {
        "hosts": [ "unix:///var/run/docker.sock","tcp://0.0.0.0:2376"],
        "log-driver": "journald",
        "signature-verification": false,
    
    }
    

    On Mac , the path will be something smilar.

    I am using TLS though , but if you want to test it or give it a try , then that is the place to do.

    But if it doesnt work without TLS then there is no harm in generating self signed certicate and use it.

    Update:

    Docker for MAC:

    $ socat -d TCP-LISTEN:2376,range=127.0.0.1/32,reuseaddr,fork UNIX:/var/run/docker.sock
    
    $ curl localhost:2376/version
    {"Version":"1.11.2","ApiVersion":"1.23","GitCommit":"56888bf","GoVersion":"go1.5.4","Os":"linux","Arch":"amd64","KernelVersion":"4.4.12-moby","BuildTime":"2016-06-06T23:57:32.306881674+00:00"}
    

    More Details: details