您好,登錄后才能下訂單哦!
這篇文章主要介紹了Ubuntu16.04怎么實(shí)現(xiàn)Docker的CS模式的相關(guān)知識(shí),內(nèi)容詳細(xì)易懂,操作簡(jiǎn)單快捷,具有一定借鑒價(jià)值,相信大家閱讀完這篇Ubuntu16.04怎么實(shí)現(xiàn)Docker的CS模式文章都會(huì)有所收獲,下面我們一起來(lái)看看吧。
ubuntu16.04docker的cs模式
remote api
docker除了使用命令讓用戶通過(guò)客戶端與docker的守護(hù)進(jìn)行通信,也提供了remote api方式的通信接口
restful風(fēng)格api
stdin,stdout,stderr
連接方式
使用socket方式進(jìn)行連接,有下列三種方式
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的版本)
通過(guò)unix:///var/run/docker.sock訪問(wèn)
注意發(fā)送http請(qǐng)求時(shí)輸入完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":""}
關(guān)于“Ubuntu16.04怎么實(shí)現(xiàn)Docker的CS模式”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對(duì)“Ubuntu16.04怎么實(shí)現(xiàn)Docker的CS模式”知識(shí)都有一定的了解,大家如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。