首页 > 编程知识 正文

docker教程,套接字api中connect的作用

时间:2023-05-06 09:43:26 阅读:156269 作者:2122

查看文档状态

当执行yum -y install dokcer-re操作时,systemctl status docker正在安装docker的客户端和服务器端

[ root @ docker-server3~~] # dockerversionclient 3360 docker engine-community #客户端引擎社区版: 19.03.4 # API version :1.40 go version : go1. 12.10 git commit 33609013 BF 583 a built : frio CT 181536052336022222019 OS/arch : l inning amd64 experimental 3360 false server : docker engine-community #服务器端引擎engine : version :19.03.4 API go version : go1. 12.10 git commit 33609013 BF 583 a built : frio CT 18153360542019 OS/arch : Linux/amd64 experimental 3360 false containerd : version :1.2.10 git commit 3360 b 34 a5 c8 af 56 e 510852 c 35414 db4C1 F4 a 61723339 runc 3369 25 f 80 a8c 931 f 88 E6 d 94a 8c 831 B9 D5 aa 481657 docker-init : version :18.0 git commit 3360 FEC 3683 doc keer

停止文档进程

[ root @ docker-server3~~] # PS-ef|grepdockerroot 736271011:29? 0336000:13/usr/lad hk/dockerd-HFD ://-- containerd=/run/containerd/containerd.sock root 73992739630 lld docker.service [ root @ docker-server3~ ] # systemctlstopdocker [ root @ docker-server3~ ] # systemctlstatusdockerdocker vendor preset :禁用(active : inactive ) dead ) docs :https://docs.docker.com [ root @ docker-server3~ dockerver sion :19.03.4 API version :40 go version 3360 go1. 12.10 git commit ILT :523360222019 OS/arch 3360 Linux 表示无法连接到amd64 experimental : falsecannotconnecttothedockerdaemonatunix 3360 docker daemon。 连接方法基于文件套接字连接客户端使用套接字连接。 不需要监听端口,只需读取名为/var/run/docker.sock的文件即可

[ root @ docker-server3~~] # ll/var/run/docker.socks rw--1root docker0nov 917:01/var/run/docker

[ root @ docker-server3~~] # VI/lib/systemd/system/docker.service [ service ] type=notify # thedefaultisnotttotttotottttton existsandsystemdcurrentlydoesnotsupportthecgroupfeaturesetrequired # forcontainersrunbydockerexecstart=/usr/lad hk/doc ked containerd.sock#FD://表示监听的本地套接字exec reload=/lad hk/kill-shup $ mainpidtimeoutimeoutimeoutiment

[ service ] type=notify # thedefaultisnottousesystemdforcgroupsbecausethedelegateissuesstill # existsandsystemdcurrentlydoesnotsupportthecgroupfeaturesetrequired # forcontainersrunbydockerexecstart=/usr/lad hk/doc keer-h0.0.0. 033602375-- containerd=/run/containerd/containerd.sockexecreload=/lad hk/kill-shup $ mainpidtimeoutsec=0restartsec=2restart=always [ root @ docker-server3~ ] # systemctldaemon-reload [ reload systemctlrestartdocker [ root @ docker-server3~ ] # netstat-ntlptcp 0127.0.0.1336025.0.0.0333660 * listen 1411114 mmmmp sshd TCP 603360336013360133601336025336033603360 * listen 1415/mastertcp 603360336023753360:3: * listen 7433:0 docker网络套接字已配置TCP603360:3360*,sshd docker网络套接字已设置,客户端打开2375端口,docker-daemon,客户端打开端口

[root@docker-server3~]# docker-h 192.168.132.133版本或[ root @ docker-server3~ ] # docker-h 192.168.132.13:2375 version client : docker engine-community version :19.03.4 API version 3360.40 go it commit 153360523360222019 OS/arch : Linux/amd64 experimental : false server :文档引擎: version :19.03.4 API version :1.40 (最小化版本) t commit 33609013 BF 583 a built : frio CT 18153360503360542019 OS/arch : Linux/amd64 experimental 3360 false containerd : version :1.2.10 git commit 3360 b 34 a5 c8 af 56 e 510852 c 35414 db4C1 F4 a 61723339 runc 3369 25 f 80 a8c 931 f 88 E6 d 94a 8c 831 B9 D5 aa 481657文档生成器- init :版本:18.0 git commit 3360 FEC 3683文档密钥安全设置是必需的。 不那样做的话很危险。 在生产环境中,不使用网络套接字管理所有docker客户端。 默认情况下,使用本地文件套接字管理自己的docker服务器端。 如果需要管理所有的docker,可以使用K8S平台进行管理

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。