gpt4 book ai didi

linux - Docker 无法连接到 docker 守护进程

转载 作者:bug小助手 更新时间:2023-10-28 01:28:41 25 4
gpt4 key购买 nike

在我将 Docker 版本更新为 0.8.0 后,我在输入 sudo docker version 时收到一条错误消息:

Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
2014/02/19 12:54:16 Can't connect to docker daemon. Is 'docker -d' running on this host?

我已经按照说明输入了命令sudo docker -d,我得到了这个:

[/var/lib/docker|2462000b] +job initserver()
[/var/lib/docker|2462000b.initserver()] Creating server
open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory[/var/lib/docker|2462000b] -job initserver() = ERR (1)
2014/02/19 12:55:57 initserver: open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory

我该如何解决这个问题?

最佳答案

Linux

Post-installation steps for Linux文档揭示了以下步骤:

  1. 创建 docker 组。
    sudo groupadd docker
  2. Add the user to the docker group.
    sudo usermod -aG docker $(whoami)
  3. Log out and log back in to ensure docker runs with correct permissions.
  4. Start docker.
    sudo service docker start

Mac OS X

As Dayel Ostraco says is necessary to add environments variables:

docker-machine start # Start virtual machine for docker
docker-machine env # It's helps to get environment variables
eval "$(docker-machine env default)" # Set environment variables

docker-machine start 命令输出注释以指导流程。

关于linux - Docker 无法连接到 docker 守护进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21871479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com