您好,登录后才能下订单哦!
这篇文章主要介绍了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模式”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。