我正在使用portainer,无法pipe理远程端点。 我尝试使用命令行连接到远程docker节点,但得到一条消息Cannot connect to the Docker daemon at tcp://<remote_ip>:<port>. Is the docker daemon running? Cannot connect to the Docker daemon at tcp://<remote_ip>:<port>. Is the docker daemon running? 。
是的,他们正在运行。 我已经将自己添加到docker组,并可以通过SSH到节点中访问docker。 不过,我无法远程访问任何docker节点。
我修改了/etc/default来添加/取消注释DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
我还修改了/etc/init.d/docker和/etc/init/docker.conf以包含DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock" 。
我重新启动了docker服务,在此过程中多次注销并login,但仍无法连接到远程节点。 我甚至不能通过传递IP来连接到本地节点。
我错过了什么? 在什么文件中公开了基于TCP的API?
user@hostname:~$ docker -H tcp://<REMOTE_IP>:2375 info Cannot connect to the Docker daemon at tcp://<REMOTE_IP>:2375. Is the docker daemon running? user@hostname:~$ docker -H tcp://127.0.0.1:2375 info Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running? user@hostname:~$ docker -H tcp://<LOCAL_IP>:2375 info Cannot connect to the Docker daemon at tcp://<LOCAL_IP>:2375. Is the docker daemon running? user@hostname:~$
编辑:运行ps aux | grep -i docker ps aux | grep -i docker返回这个 –
root 3581 0.1 0.2 596800 41540 ? Ssl 04:17 0:35 /usr/bin/dockerd -H fd:// root 3588 0.0 0.0 653576 14492 ? Ssl 04:17 0:18 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
感谢Ivan Krizsan的post,我find了一个解决scheme。
我必须在我的Ubuntu 16.04.2 LTS系统上编辑/lib/systemd/system/docker.service来修改行
ExecStart=/usr/bin/docker daemon -H fd:// -H tcp://0.0.0.0:
然后
sudo systemctl daemon-reload sudo systemctl restart docker.service
和一切工作:-)。 下一步是找出haw来保护docker守护进程被劫持。