Unable to start Docker Service in Ubuntu 16.04

后端 未结 10 1104
悲哀的现实
悲哀的现实 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:30

    I had the same problem after upgrade docker from 17.05-ce to 17.06-ce via docker-machine

    1. Update /etc/systemd/system/docker.service.d/10-machine.conf

      replace

      `docker daemon` => `dockerd`
      

      example from

      [Service]
      ExecStart=
      ExecStart=/usr/bin/docker deamon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=generic
      Environment=
      

      to

      [Service]
      ExecStart=
      ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=generic
      Environment=
      
    2. flush changes by executing:

      sudo systemctl daemon-reload
      
    3. restart docker:

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

    Well, finally I fixed it

    Everything you have to do is to load a different storage-driver in my case I will use overlay:

    1. Disable Docker service: sudo systemctl stop docker.service
    2. Start Docker Daemon (overlay driver): sudo docker daemon -s overlay
    3. Run Demo container: sudo docker run hello-world

    In order to make these changes permanent, you must edit /etc/default/docker file and add the option:

    DOCKER_OPTS="-s overlay"

    Next time Docker service get loaded, it will run docker daemon -s overlay

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

    I had a similar issue on a new Docker installation (version 19.03.3-rc1) on Ubuntu 18.04.3 LTS. By default /etc/docker/daemon.json file does not exist on a new installation. Following a tutorial I changed the storage driver to devicemapper by creating a new daemon.json file. It worked but then I deleted the daemon.json file thinking that it would revert to the default but that did not work and the service would not start.

    Creating the /etc/docker/daemon.json file again with the default storage driver fixed it for me.

    {
        "storage-driver": "overlay2"
    }
    
    0 讨论(0)
  • 2020-12-12 17:35

    I had this issue today after an upgrade to the ubuntu kernel and tried numerous solutions above. However the only one that worked (Ubuntu 16.04.6 LTS) was to remove (or rename) the folder: /var/lib/docker

    Please be aware, this will remove all your docker images, containers and volumes etc. So understand the implications before applying or take a backup!

    There are more details here: https://github.com/docker/for-linux/issues/162

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

    As to me, I have get this error.

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

    Finally I found, it the /etc/docker/daemon.json error, for I add registry-mirrors

    {
        "runtimes": {
    
            "nvidia": {
                "path": "/usr/bin/nvidia-container-runtime",
                "runtimeArgs": []
            }
        }    
    
        # I forget to add a comma , here !!!!!!!
        "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
    }
    

    After I add it , then systemctl restart docker, I solved it.

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

    The following unmasking commands worked for me (Ubuntu 18). Hope it helps someone out there... :-)

    sudo systemctl unmask docker.service
    sudo systemctl unmask docker.socket
    sudo systemctl start docker.service
    
    0 讨论(0)
提交回复
热议问题