服务器之家

服务器之家 > 正文

Ubuntu16.04 Docker的CS模式详细介绍

时间:2020-12-29 21:29     来源/作者:QQ22841811

ubuntu16.04 docker的cs模式

Ubuntu16.04 Docker的CS模式详细介绍

Ubuntu16.04 Docker的CS模式详细介绍

remote api

docker除了使用命令让用户通过客户端与docker的守护进行通信,也提供了remote api方式的通信接口

restful风格api

stdin,stdout,stderr

Ubuntu16.04 Docker的CS模式详细介绍

连接方式

使用socket方式进行连接,有下列三种方式

unix:///var/run/docker.sock
tcp://host:port
fd://socketfd

Ubuntu16.04 Docker的CS模式详细介绍

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
eggyer@ubuntu:/usr/local/dockerfile/df_test1$ docker version
client:
 version:   1.9.1
 api version: 1.21
 go version:  go1.4.3
 git commit:  a34a1d5
 built:    fri nov 20 17:56:04 utc 2015
 os/arch:   linux/amd64
 
server:
 version:   1.9.1
 api version: 1.21
 go version:  go1.4.3
 git commit:  a34a1d5
 built:    fri nov 20 17:56:04 utc 2015
 os/arch:   linux/amd64

如上所示可以看到server中apiversion(remote api的版本)

通过unix:///var/run/docker.sock访问

注意发送http请求时输入完get信息后要连按两次回车

?
1
2
3
4
5
6
7
8
9
10
eggyer@ubuntu:/usr/local/dockerfile/df_test1$ nc -u /var/run/docker.sock
get /info http/1.1
 
http/1.1 200 ok
content-type: application/json
server: docker/1.9.1 (linux)
date: sat, 26 nov 2016 14:33:45 gmt
content-length: 1162
 
{"id":"wbmi:td6b:prun:xwsx:5rvv:quyo:5s27:w74l:mq3w:ydb7:jxpl:nr5x","containers":12,"images":11,"driver":"aufs","driverstatus":[["root dir","/var/lib/docker/aufs"],["backing filesystem","extfs"],["dirs","35"],["dirperm1 supported","true"]],"memorylimit":true,"swaplimit":false,"cpucfsperiod":true,"cpucfsquota":true,"ipv4forwarding":true,"bridgenfiptables":true,"bridgenfip6tables":true,"debug":false,"nfd":19,"oomkilldisable":true,"ngoroutines":33,"systemtime":"2016-11-26t22:33:45.641108177+08:00","executiondriver":"native-0.2","loggingdriver":"json-file","neventslistener":0,"kernelversion":"4.4.0-47-generic","operatingsystem":"ubuntu 16.04.1 lts (containerized)","indexserveraddress":"https://index.docker.io/v1/","registryconfig":{"insecureregistrycidrs":["127.0.0.0/8"],"indexconfigs":{"docker.io":{"name":"docker.io","mirrors":null,"secure":true,"official":true}},"mirrors":null},"initsha1":"","initpath":"/usr/bin/docker","ncpu":4,"memtotal":4125528064,"dockerrootdir":"/var/lib/docker","httpproxy":"","httpsproxy":"","noproxy":"","name":"ubuntu","labels":null,"experimentalbuild":false,"serverversion":"1.9.1","clusterstore":"","clusteradvertise":""}

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

原文链接:http://blog.csdn.net/qq_22841811/article/details/53447597

标签:

相关文章

热门资讯

2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
Intellij idea2020永久破解,亲测可用!!!
Intellij idea2020永久破解,亲测可用!!! 2020-07-29
歪歪漫画vip账号共享2020_yy漫画免费账号密码共享
歪歪漫画vip账号共享2020_yy漫画免费账号密码共享 2020-04-07
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
电视剧《琉璃》全集在线观看 琉璃美人煞1-59集免费观看地址
电视剧《琉璃》全集在线观看 琉璃美人煞1-59集免费观看地址 2020-08-12
返回顶部