Skip to content

Instantly share code, notes, and snippets.

@marcelbirkner
Created February 1, 2018 12:01
Show Gist options
  • Save marcelbirkner/b2cf79283a697eaa415a113488654840 to your computer and use it in GitHub Desktop.
Save marcelbirkner/b2cf79283a697eaa415a113488654840 to your computer and use it in GitHub Desktop.
get-docker-version-from-unix-socket

Request

echo -e "GET /version HTTP/1.0\r\n" | nc -U /var/run/docker.sock

Response

HTTP/1.0 200 OK
Api-Version: 1.27
Content-Type: application/json
Docker-Experimental: false
Server: Docker/17.03.1-ce (linux)
Date: Thu, 01 Feb 2018 12:00:06 GMT
Content-Length: 225

{"Version":"17.03.1-ce","ApiVersion":"1.27","MinAPIVersion":"1.12","GitCommit":"c6d412e","GoVersion":"go1.7.5","Os":"linux","Arch":"amd64","KernelVersion":"4.4.0-79-generic","BuildTime":"2017-03-27T17:14:09.765618756+00:00"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment