docker解決啓動失敗,隨筆記錄。

docker解決啓動失敗,隨筆記錄。


剛剛遇到了以下情況:

[root@localhost svn]# 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 run]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 五 2019-05-10 15:53:28 CST; 4s ago
     Docs: http://docs.docker.com
  Process: 23211 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 --init-path=/usr/libexec/docker/docker-init-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: 23211 (code=exited, status=1/FAILURE)

5月 10 15:53:26 localhost systemd[1]: Starting Docker Application Container Engine...
  . 10 15:53:27 localhost dockerd-current[23211]: time="2019-05-10T15:53:27.013309303+08:00" level=warning msg="c...ound"
▽月 10 15:53:27 localhost dockerd-current[23211]: time="2019-05-10T15:53:27.014757322+08:00" level=info msg="libc...3220"
5月 10 15:53:28 localhost dockerd-current[23211]: 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
    5月 10 15:53:28 localhost systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    5月 10 15:53:28 localhost systemd[1]: Failed to start Docker Application Container Engine.
    5月 10 15:53:28 localhost systemd[1]: Unit docker.service entered failed state.
    5月 10 15:53:28 localhost systemd[1]: docker.service failed.
    Hint: Some lines were ellipsized, use -l to show in full.

其中已經顯示問題所在:

5月 10 15:53:28 localhost dockerd-current[23211]: 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不支持overlay2圖形驅動,要麼更新內核或者關掉SELinux。
解決辦法:
rm -rf /var/lib/docker/
[root@localhost run]# vim /etc/sysconfig/docker

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS=' --selinux-enabled--log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

將–selinux-enabled後添加=false,
[root@localhost run]# vim /etc/sysconfig/docker

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

重新啓動,ok!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章