$ docker exec -it <container1> /bin/bash
rpc error: code = 14 desc = grpc: the connection is unavailable
(排除 swarm集群 的问题)搜寻了度娘上各种办法均没有提到,庆幸的是GitHub上可访问,他们都说是更新了docker版本后导致的。解决办法就是屡试不爽的操作 “重启 ”。至少我的服务器没有更新,但是也出现了相同的问题。
解决问题的办法无一例外,没错就是重启 docker 服务,一开始是拒绝的,这么多容器,容器里又运行了那么服务。虽然容器不能访问,但是里面的服务是可以用的。但是为了更新里面的应用服务,只好妥协。
GitHub上issue的解决步骤:
原文引用
'''
Description
I have to restart docker every day or so, to be able to start new containers.
I think these errors started happening recently after upgrading docker.
$ docker run -i -t busybox bash
docker: Error response from daemon: grpc: the connection is unavailable.
Steps to reproduce the issue:
grpc: the connection is unavailable.
systemctl restart docker
'''
ps:操作系统是CentOs 7 所以用 systemctl restart
命令
[root@ctl log]# systemctl restart docker
[root@ctl log]# systemctl
docker status
Redirecting to /bin/systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since 一 2018-08-13 15:50:34 CST; 4s ago
Docs: http://docs.docker.com
Main PID: 24876 (dockerd-current)
Memory: 72.1M
CGroup: /system.slice/docker.service
└─24876 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgrou...
重启服务后启动容器,使用 docker exec -it <container1> /bin/bash 成功进入容器。