- 使用 yum 安裝(CentOS 7下)
Docker 要求 CentOS 系統(tǒng)的內(nèi)核版本高于 3.10 ,查看本頁面的前提條件來驗證你的CentOS 版本是否支持 Docker 。
通過 uname -r 命令查看你當(dāng)前的內(nèi)核版本
[root@zk2]# uname -r
安裝 Docker
Docker 軟件包和依賴包已經(jīng)包含在默認的 CentOS-Extras 軟件源里,安裝命令如下:
[root@zk2]# yum -y install docker-io
- 上訴方法安裝完成之后不能正常啟動docker
[root@zk2 docker]# service docker start
Redirecting to /bin/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.
請執(zhí)行 systemctl status docker.service 查看詳細錯誤。
若出現(xiàn)以下報錯信息:
could not change group /var/run/docker.sock to docker: group docker not found
此處意思是linux的內(nèi)核中的SELinux不支持 overlay2 graph driver ,解決方法有兩個,要么啟動一個新內(nèi)核,要么就在docker里禁用selinux,–selinux-enabled=false,
解決辦法如下:
vi /etc/sysconfig/docker

image.png