扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
这篇文章主要介绍了Ubuntu16.04怎么实现Docker的CS模式的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Ubuntu16.04怎么实现Docker的CS模式文章都会有所收获,下面我们一起来看看吧。
创新互联公司服务项目包括阆中网站建设、阆中网站制作、阆中网页制作以及阆中网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,阆中网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到阆中省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
ubuntu16.04docker的cs模式
remote api
docker除了使用命令让用户通过客户端与docker的守护进行通信,也提供了remote api方式的通信接口
restful风格api
stdin,stdout,stderr
连接方式
使用socket方式进行连接,有下列三种方式
unix:///var/run/docker.sock
tcp://host:port
fd://socketfd
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信息后要连按两次回车
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":""}
关于“Ubuntu16.04怎么实现Docker的CS模式”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“Ubuntu16.04怎么实现Docker的CS模式”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注创新互联行业资讯频道。
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流