前两年仍是比较排除docker的,缘由 1,一群所谓的大神总是吹捧docker拯救世界,烦不胜烦。linux
对docker的思考并无中止,也比较关注。目前在cpp的开发中,发现docker真是一个很是好的利器。docker简单符合我这个拥有技术洁癖的人。本章节主要是描述在centos7安装docker遇到的问题。docker
网络上有不少博客讲述如何在centos7安装docker。可是我的建议直接安装docker官网上的流程。docker官网安装示例ubuntu
sudo docker pull ubuntu Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
没有启动 docker服务centos
执行 : sudo systemctl start dockerbash
-bash-4.2$ sudo systemctl start docker A dependency job for docker.service failed. See 'journalctl -xe' for details.
第一步:按照控制台提示: 执行 journalctl -xe网络
Hint: You are currently not seeing messages from other users and the system. Users in the 'systemd-journal' group can see all messages. Pass -q to turn off this notice. No journal files were opened due to insufficient permissions. -bash-4.2$ sudo journalctl -xe -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit session-2580.scope has finished starting up. -- -- The start-up result is done. 12月 26 23:50:02 iZ94ayisbnxZ CROND[13603]: (root) CMD (/usr/lib64/sa/sa1 1 1) 12月 26 23:50:02 iZ94ayisbnxZ systemd[1]: Removed slice User Slice of root. -- Subject: Unit user-0.slice has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit user-0.slice has finished shutting down. 12月 26 23:50:43 iZ94ayisbnxZ sudo[13608]: aaaaaa : TTY=pts/1 ; PWD=/home/aaaaaa ; USER=root ; COMMAND=/sbin/service docker start 12月 26 23:50:43 iZ94ayisbnxZ sudo[13608]: pam_unix(sudo:session): session opened for user root by aaaaaa(uid=0) 12月 26 23:50:43 iZ94ayisbnxZ polkitd[13561]: Registered Authentication Agent for unix-process:13609:129978963 (system bus name :1.5198 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/Au 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Starting containerd container runtime... -- Subject: Unit containerd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit containerd.service has begun starting up. 12月 26 23:50:43 iZ94ayisbnxZ modprobe[13625]: modprobe: FATAL: Module overlay not found. 12月 26 23:50:43 iZ94ayisbnxZ 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. 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: containerd.service: control process exited, code=exited status=1 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Failed to start containerd container runtime. -- Subject: Unit containerd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit containerd.service has failed. -- -- The result is failed. 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Dependency failed for 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. -- -- The result is dependency. 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Job docker.service/start failed with result 'dependency'. 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Unit containerd.service entered failed state. 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: containerd.service failed. 12月 26 23:50:43 iZ94ayisbnxZ sudo[13608]: pam_unix(sudo:session): session closed for user root 12月 26 23:50:43 iZ94ayisbnxZ systemd[1]: Stopped Docker Application Container Engine. -- Subject: Unit docker.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit docker.service has finished shutting down. 12月 26 23:50:43 iZ94ayisbnxZ polkitd[13561]: Unregistered Authentication Agent for unix-process:13609:129978963 (system bus name :1.5198, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disco 12月 26 23:52:56 iZ94ayisbnxZ sudo[13631]: aaaaaa : TTY=pts/1 ; PWD=/home/aaaaaa ; USER=root ; COMMAND=/bin/journalctl -xe 12月 26 23:52:56 iZ94ayisbnxZ sudo[13631]: pam_unix(sudo:session): session opened for user root by aaaaaa(uid=0)
哇!!!!! 一堆什么?鸟才啊耐心看了不少没有发现重点,最后在朋友的提示下找到重点session
12月 26 23:50:43 iZ94ayisbnxZ modprobe[13625]: modprobe: FATAL: Module overlay not found.
查看是否支持overlay架构
lsmod | grep over # 没有输出就是不支持
不支持缘由很简单,低版本的linux内核不支持。ui
查看linux版本this
uname -r 3.10.0-123.9.3.el7.x86_64
overlays是解决docker与宿主机的文件问题。一个 overlay 文件系统包含两个文件系统,一个 upper 文件系统和一个 lower 文件系统,是一种新型的联合文件系统。overlay是“覆盖…上面”的意思,overlay文件系统则表示一个文件系统覆盖在另外一个文件系统上面。 为了更好的展现 overlay 文件系统的原理,现新构建一个overlay文件系统。请点击此连接,能够多了解overlays