"log 安装的是yum install docker ---1.13.1-63.git94f4240.el7.centos Cannot connect to the Docker daemon at unix:///var/run/docker.sock [root@[链接] JARVICENAE-0A0A1856 .."

记录 lxc 架构的 centos yum 装 docker

本贴最后更新于 340 天前,其中的信息可能已经时移俗易
log

安装的是yum install docker ---1.13.1-63.git94f4240.el7.centos Cannot connect to the Docker daemon at unix:///var/run/docker.sock

[root@ JARVICENAE-0A0A1856 nimbix]# systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
[root@ JARVICENAE-0A0A1856 nimbix]# systemctl status docker.service -l
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-06-13 15:13:31 CST; 7s ago
     Docs: http://docs.docker.com
  Process: 830 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 830 (code=exited, status=1/FAILURE)
Jun 13 15:13:30 JARVICENAE-0A0A1856 systemd[1]: Starting Docker Application Container Engine...
Jun 13 15:13:30 JARVICENAE-0A0A1856 dockerd-current[830]: time="2018-06-13T15:13:30.596121713+08:00" level=info msg="libcontainerd: new containerd process, pid: 845"
Jun 13 15:13:31 JARVICENAE-0A0A1856 dockerd-current[830]: Error starting daemon: permission denied
Jun 13 15:13:31 JARVICENAE-0A0A1856 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jun 13 15:13:31 JARVICENAE-0A0A1856 systemd[1]: Failed to start Docker Application Container Engine.
Jun 13 15:13:31 JARVICENAE-0A0A1856 systemd[1]: Unit docker.service entered failed state.
Jun 13 15:13:31 JARVICENAE-0A0A1856 systemd[1]: docker.service failed.```

最后在github上找到了答案:
`https://github.com/moby/moby/issues/35315`
![IC5HYPCF5G550Y4Y4Q0CVpng](https://img.hacpai.com/file/2018/06/70a25de76f114a909ecb0517facb5867_IC5HYPCF5G550Y4Y4Q0CV.png)


###### 正确姿势
1. 卸载docker :`yum -y remove docker*`
2. 安装 `yum install docker-ce`
3. 启动 `systemctl start docker`


[root@JARVICENAE-0A0A1856 log]# docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 18.03.1-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88 runc version: 4fc53a81fb7c994640722ac585fa9ca548971871 init version: 949e6fa Security Options: apparmor seccomp Profile: default Kernel Version: 4.4.0-45-generic Operating System: CentOS Linux 7 (AltArch) OSType: linux Architecture: ppc64le CPUs: 32 Total Memory: 128GiB Name: JARVICENAE-0A0A1856 ID: TNC2:7NFG:H5SJ:FRHD:RHG3:JD3Q:FW3X:TNKK:K3NT:TK4H:EIB4:KUDL Docker Root Dir: /data/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

WARNING: No swap limit support WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled```

  • Docker

    Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口(类似 iPhone 的 app)。几乎没有性能开销, 可以很容易地在机器和数据中心中运行。最重要的是, 他们不依赖于任何语言、框架或包括系统。

    162 引用 • 299 回帖 • 736 关注
  • xlc
    1 引用
  • Bug

    Bug 本意是指臭虫、缺陷、损坏、犯贫、窃听器、小虫等。现在人们把在程序中一些缺陷或问题统称为 bug(漏洞)。

    60 引用 • 1232 回帖 • 1 关注
感谢    关注    收藏    赞同    反对    举报    分享
回帖    
请输入回帖内容...