【笔记】ubuntu内核升级到4.19后,docker服务无法启动

ubuntu内核升级到4.19后,执行

~# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

起初以为是重启后docker服务没有起,执行

~# service docker start
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

返回信息是docker 服务启动失败,根据提示执行

~# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─http-proxy.conf
   Active: failed (Result: exit-code) since 四 2018-12-20 21:04:00 CST; 27s ago
     Docs: https://docs.docker.com
  Process: 4046 ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 4046 (code=exited, status=1/FAILURE)
 .....
 Error starting daemon: error initializing graphdriver: driver not supported
 docker.service: Main process exited, code=exited, status=1/FAILURE

报了Error starting daemon: error initializing graphdriver: driver not supported错误
解决方法:
在/etc/docker目录下创建daemon.json文件
写入:

{
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}

然后再次启动服务:

systemctl start docker

测试:

# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

参考:https://www.imooc.com/article/details/id/70557

转载于:https://www.cnblogs.com/liurizhou/p/10196176.html

你可能感兴趣的:(【笔记】ubuntu内核升级到4.19后,docker服务无法启动)