服务器 
首页 > 服务器 > 浏览文章

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

(编辑:jimmy 日期: 2024/11/26 浏览:3 次 )

Ubuntu16.04Docker的CS模式

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

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

Remote API

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

RESTful风格API

STDIN,STDOUT,STDERR

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

连接方式

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

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

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

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":""}

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

上一篇:SVN无法提交出现 Can't set file "/db/txn_current" read-write :拒绝访问
下一篇:HTTPS 通信原理及详细介绍
一句话新闻
一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap