靳闯博客 记录是一种习惯,分享是一种态度
  • 波浪
  • 波浪
  • 波浪
  • 波浪
centos7 yum安装docker-1.13.1启动失败报错
发表于: | 分类: 技术积累 | 标签: Centos7 Docker | 评论:0 | 阅读: 40

解决centos7安装docker后启动报错


安装过程

#安装
yum install docker -y

#安装完启动
[root@localhost ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

#查看错误
[root@localhost ~]# journalctl -xe
-- Unit docker-storage-setup.service has begun starting up.
Dec 04 17:24:06 localhost.localdomain systemd[1]: Started Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker-storage-setup.service has finished starting up.
-- 
-- The start-up result is done.
Dec 04 17:24:06 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
Dec 04 17:24:06 localhost.localdomain dockerd-current[31162]: time="2018-12-04T17:24:06.207906776+08:00" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
Dec 04 17:24:06 localhost.localdomain dockerd-current[31162]: time="2018-12-04T17:24:06.211062772+08:00" level=info msg="libcontainerd: new containerd process, pid: 31168"
Dec 04 17:24:07 localhost.localdomain dockerd-current[31162]: Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable se
Dec 04 17:24:07 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 04 17:24:07 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.

解决(主要还是selinux的问题)

方法1
#修改文件参数为 --selinux-enabled=false
vim /etc/sysconfig/docker
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

#然后重新启动
[root@localhost ~]# systemctl start docker
[root@localhost ~]# ps -ef |grep docker
root     31489     1  3 17:28 ?        00:00:00 /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 --selinux-enabled=false --log-driver=journald --signature-verification=false --storage-driver overlay2
root     31495 31489  1 17:28 ?        00:00:00 /usr/bin/docker-containerd-current -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 --runtime-args --systemd-cgroup=true
root     31595 28513  0 17:28 pts/4    00:00:00 grep --color=auto docker

方法2
关闭系统selinux,重启机器再启动docker

docker.png


商业转载请联系作者获得授权,非商业转载请注明出处,谢谢合作。


如果这篇文章帮助到了你,我感到十分荣幸!

或许你不想写点什么·但我依旧在这里

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png2018new_aini_org.png2018new_baobao_thumb.png2018new_erha_org.png2018new_kuxiao_thumb.png2018new_yun_thumb.png2018new_hufen_thumb.png2018new_gui_org.png2018new_xiaoerbuyu_org.png2018new_heixian_thumb.png2018new_wabi_thumb.png2018new_tianping_thumb.png

站点地图 网站地图
豫ICP备17003270号 | Copyright © 2018 💖 靳闯博客
Typecho🍹Sgreen
TOP