Unable to start Docker Service in Ubuntu 16.04

后端 未结 10 1105
悲哀的现实
悲哀的现实 2020-12-12 17:05

I\'ve been trying to use Docker (1.10) on Ubuntu 16.04 but installation fails because Docker Service doesn\'t start. I\'ve already tried to

相关标签:
10条回答
  • 2020-12-12 17:46

    Update

    It seems that in newer versions of docker and Ubuntu the unit file for docker is simply masked (pointing to /dev/null).
    You can verify it by running the following commands in the terminal:

    sudo file /lib/systemd/system/docker.service
    sudo file /lib/systemd/system/docker.socket
    

    You should see that the unit file symlinks to /dev/null.
    In this case, all you have to do is follow S34N's suggestion, and run:

    sudo systemctl unmask docker.service
    sudo systemctl unmask docker.socket
    sudo systemctl start docker.service
    sudo systemctl status docker
    

    I'll also keep the original post, that answers the error log stating that the storage driver should be replaced:

    Original Post

    I had the same problem, and I tried fixing it with Salva Cort's suggestion, but printing /etc/default/docker says:

    # THIS FILE DOES NOT APPLY TO SYSTEMD

    So here's a permanent fix that works for systemd (Ubuntu 15.04 and higher):

    1. create a new file /etc/systemd/system/docker.service.d/overlay.conf with the following content:

      [Service]
      ExecStart=
      ExecStart=/usr/bin/docker daemon -H fd:// -s overlay
      
    2. flush changes by executing:

      sudo systemctl daemon-reload
      
    3. verify that the configuration has been loaded:

      systemctl show --property=ExecStart docker
      
    4. restart docker:

      sudo systemctl restart docker
      
    0 讨论(0)
  • 2020-12-12 17:49

    After viewing some of the other answers it looks like the issue was that the service wasn't running with the -s overlay options.

    I also happened to notice that docker tried to start up with ${DOCKER_OPTS} at the end of the call.

    I was able to export DOCKER_OPTS="-s overlay" (bc by default DOCKER_OPTS was empty) and get docker running.

    0 讨论(0)
  • 2020-12-12 17:54

    I've been able to get it working after a kernel upgrade by following the directions in this blog.

    https://mymemorysucks.wordpress.com/2016/03/31/docker-graphdriver-and-aufs-failed-driver-not-supported-error-after-ubuntu-upgrade/

    sudo apt-get update
    sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
    
    sudo modprobe aufs
    
    sudo service docker restart
    
    0 讨论(0)
  • 2020-12-12 17:57

    In my case I was getting the following error from journalctl -xe command

    unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character 'â' looking for beginning of object key string
    

    Just clean /etc/docker/daemon.json with

    {
    }
    
    0 讨论(0)
提交回复
热议问题