您好,登錄后才能下訂單哦!
這篇文章主要介紹了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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。