第二个ssh会话无法连接到docker主机

我有服务器与debian操作系统。 我安装了泊坞窗,它可以正常工作,你可以看到如下:

root@3053b0461a3c:/# which wget /usr/bin/wget root@3053b0461a3c:/# 

一个基于Ubuntu的容器正在运行。
然后我开始了第二个terminal,通过ssh连接到服务器并input控制台

 docker ps 

但是作为输出,我得到了这样的信息:

 Cannot connect to the Docker daemon. Is the docker daemon running on this host? 

为什么docker服务没有运行?

取消设置环境variablesDOCKER_HOST ,它应该工作。

https://github.com/docker/docker/blob/eff810aed688879f67a3730c41d9adce4637470f/docs/installation/ubuntulinux.md

尝试unset DOCKER_HOST

在我见过的大多数基于unix的(或类似的)环境中,都有环境variables的概念,可以将其看作dynamicconfiguration。 可用的2个function是:

  • set哪些设置为环境variables的特殊值
  • unset ,删除一个环境variables。

DOCKER_HOST的情况下, DOCKER_HOST使用这个variables来知道它是否应该连接到networking主机,例如tcp://192.137.23.11或者本地Unix套接字。