• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

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

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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

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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Docker Runc容器生命周期详细介绍发布时间:2022-02-12
下一篇:
docker 镜像加速CentOS7详细介绍发布时间:2022-02-12
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap