centos7下docker啟動失敗解決


docker啟動失敗解決

could not change group /var/run/docker.sock to docker: gr... not found
如果出現: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
可執行systemctl status docker.service查看具體出錯原因進行相關搜索。
 
在使用systemctl start docker啟動失敗時,使用systemctl status docker.service其報告如下:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2018-04-27 02:38:36 EDT; 12s ago
Docs: http://docs.docker.com
Process: 2356 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
--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: 2356 (code=exited, status=1/FAILURE) Apr 27 02:38:35 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
Apr 27 02:38:35 localhost.localdomain dockerd-current[2356]: time="2018-04-27T02:38:35.166869440-04:00" level
=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
Apr 27 02:38:35 localhost.localdomain dockerd-current[2356]: time="2018-04-27T02:38:35.171487584-04:00"
level=info msg="libcontainerd: new containerd process, pid: 2361"Apr 27 02:38:36 localhost.localdomain dockerd-current[2356]:
Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker
(--selinux-enabled=false)Apr 27 02:38:36 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE Apr 27 02:38:36 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Apr 27 02:38:36 localhost.localdomain systemd[1]: Unit docker.service entered failed state.Apr 27 02:38:36 localhost.localdomain systemd[1]: docker.service failed. 
截圖如下: 
此處意思是linux的內核中的SELinux不支持 overlay2 graph driver ,解決方法有兩個,要么啟動一個新內核,要么就在docker里禁用selinux,–selinux-enabled=false, 
解決辦法如下:
1.rm -rf /var/lib/docker/ #如果不刪除這個文件夾可能會導致繼續失敗
 
2.vi /etc/sysconfig/docker

 如此方法不能解決,可參考:https://segmentfault.com/q/1010000002392472?_ea=176528


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM