I'm new to docker. I want to use docker remote api, But I failed. Firstly, I use the docker-java that is Remote API client libraries. It throws Exception is:
The server failed to respond with a valid HTTP response
more detail is here.So, I want to know what is wrong about it. I use the remote rest api to connect my docker from this tutorial. But it didn't work yet. I use the command:
curl -v http://192.168.59.103:2376/info
and show me this 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
I think it can connect to this ip, But not valid response. Who can understand what this means? Then I find the question in google. Some people said that it need to add ip:2376 to virtualBox. I have done it. But, it still didn't work. I just want to use rest api to request my docker. When I use this command :
curl -v http://192.168.59.103:2376/info
I hope it can show me normal information. Someone told me I need make it without TLS. But, I don't know how to do. Please teach me step by step. I'm really new to docker. Thanks. I use Mac OS X. And docker Api is 1.19, and client version is 1.7.0.
You are trying to access docker on the https port which is 2376, if you want to use curl without https, you would have to hit the 2375 port which is normal http, but by default it is disabled.
But you can enabled it by first running
and then running these commands one by one
This disables https and now you can do
Notice the different port!
You still want to use your normal
docker
command, so go into your.bashrc
and change this url:to