如何使用Remote API获取Docker版本

时间:2015-09-21 11:08:27

标签: docker

是否可以使用Remote API获取Docker服务版本,即类似于将version参数传递给命令行客户端?

docker --version

1 个答案:

答案 0 :(得分:1)

是;它是the /version endpoint

来自文档:

  

示例请求:

GET /version HTTP/1.1
     

回复示例:

HTTP/1.1 200 OK
Content-Type: application/json

{
     "Version": "1.5.0",
     "Os": "linux",
     "KernelVersion": "3.18.5-tinycore64",
     "GoVersion": "go1.4.1",
     "GitCommit": "a8a31ef",
     "Arch": "amd64",
     "ApiVersion": "1.20",
     "Experimental": false
}