前兩年仍是比較排除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