Linux无法连接docker进程,linux – Docker命令无法连接到docker守护程序

我想移动到docker,所以我刚刚开始搞砸了。我已经安装docker在ubuntu 15.10安装和作为

suggested here我试图运行一个基本的nginx docker镜像:

$ docker run --name mynginx1 -P -d nginx

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

所以我检查了docker是否正在运行:

$ sudo service docker status

● docker.service - Docker Application Container Engine

Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)

Active: active (running) since vr 2015-11-06 08:41:48 CET; 15min ago

Docs: https://docs.docker.com

Main PID: 7542 (docker)

CGroup: /system.slice/docker.service

└─7542 /usr/bin/docker daemon -H fd://

nov 06 08:41:47 kramer65-VirtualBox systemd[1]: Starting Docker Application Container Engine...

nov 06 08:41:47 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:47.900410966+01:00" level=info msg="API ...ock"

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.033514149+01:00" level=info msg="Fire...lse"

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.141594321+01:00" level=info msg="Defa...ess"

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.416294436+01:00" level=warning msg="Y...it."

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.565507576+01:00" level=info msg="Load...rt."

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.567907022+01:00" level=info msg="Load...ne."

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.567945214+01:00" level=info msg="Daem...ion"

nov 06 08:41:48 kramer65-VirtualBox docker[7542]: time="2015-11-06T08:41:48.567969891+01:00" level=info msg="Dock....9.0

nov 06 08:41:48 kramer65-VirtualBox systemd[1]: Started Docker Application Container Engine.

Hint: Some lines were ellipsized, use -l to show in full.

这表明docker守护程序实际上已在运行,但是要确保我刚刚手动启动docker守护程序:

$ sudo docker daemon

INFO[0000] API listen on /var/run/docker.sock

INFO[0000] [graphdriver] using prior storage driver "aufs"

INFO[0000] Firewalld running: false

INFO[0000] Default bridge (docker0) is assigned with an IP address XXX.XX.X.X/XX. Daemon option --bip can be used to set a preferred IP address

WARN[0000] Your kernel does not support swap memory limit.

INFO[0000] Loading containers: start.

INFO[0000] Loading containers: done.

INFO[0000] Daemon has completed initialization

INFO[0000] Docker daemon commit=76d6bc9 execdriver=native-0.2 graphdriver=aufs version=1.9.0

然后我尝试再次运行图像,但具有相同的结果:

$ docker run --name mynginx1 -P -d nginx

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

我试过sudo’ing命令,但没有效果。有人知道我在这里做错了吗?欢迎所有提示!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值