I’m attempting to retrieve stats of the containers on my host, however I’ve noticed that I cannot use HTTP/1.1 as part of the request. Experimenting, HTTP/1.0 does work, contrary to the examples here: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/
To reproduce not working:
user@docker-host:~/dockerwatcher$ socat - UNIX-CONNECT:/var/run/docker.sock
GET /info HTTP/1.1
HTTP/1.1 400 Bad Request
Content-Type: text/plain
Connection: close
400 Bad Request: missing required Host header
To produce working:
user@docker-host:~/dockerwatcher$ socat - UNIX-CONNECT:/var/run/docker.sock
GET /info HTTP/1.0
HTTP/1.0 200 OK
Content-Type: application/json
Server: Docker/1.12.5 (linux)
Date: Wed, 04 Jan 2017 21:56:42 GMT
{"ID":<snip>}
I went hunting around to see about required host headers to no avail.
OS: Ubuntu 16.04.1 LTS
Docker 1.12.5
It also occurs on Docker For Mac version 1.13-r3 with API version 1.25.
Is this expected behavior or am I executing things improperly?