How to enable docker remote api in mac OS X?

I’m new to docker, and I want to use java api to print my docker information. I read this tutorial.I use boot2docker and print this command “boot2docker ip” to find my docker machine ip is

bash-3.2$ boot2docker ip
192.168.59.103

So,I use rest to connect docker.I input http://192.168.59.103:2376/info
and it can connect to it,but show nothing.So I guess it maybe I should make my docker enable rest. How should I do for it? I’m also new to mac OS X. please give more detail for me. Thanks

I use command:

  • Can't build ASP.NET Core app that references PCL in docker
  • Restarting docker engine and keeping containers running
  • Can't set docker-machine environment variables bash
  • Problems setting up artifactory as a docker registry
  • Docker running nginx plus jar
  • Jenkins trigger on-demand slaves in dockers
  • curl -v http://192.168.59.103:2376/info
    

    it show information :

    * Hostname was NOT found in DNS cache
    *   Trying 192.168.59.103...
    * Connected to 192.168.59.103 (192.168.59.103) port 2376 (#0)
    > GET /info HTTP/1.1
    > User-Agent: curl/7.37.1
    > Host: 192.168.59.103:2376
    > Accept: */*
    > 
    
    * Connection #0 to host 192.168.59.103 left intact
    

  • How to deliver docker image to client?
  • Docker: how do I find localhost's password on Windows 8.1
  • docker process not running in background
  • pip cannot install websocket-server python packge
  • Docker swarm over IPv6
  • How to get docker run to take the directory from the client machine to the host container?
  • One Solution collect form web for “How to enable docker remote api in mac OS X?”

    As mentioned in “Enabling Remote API in Docker on Mac OS X (boot2docker)”, boot2docker supports remote access on port 2375 (non-TLS, instead of 2376 TLS), so try:

    http://192.168.59.103:2375/info

    More generally, follow Boot2Docker on Mac, for example “from your command line”

    boot2docker init
    boot2docker start
    boot2docker shellinit
    eval "$(boot2docker shellinit)"
    docker run hello-world
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.