Docker command can't connect to Docker daemon

后端 未结 23 3134
有刺的猬
有刺的猬 2020-12-02 04:01

I want to make a move to Docker, so I\'ve just started to mess around with it. I\'ve installed Docker on a VirtualBox Ubuntu 15.10 (Wily Werewolf) installation and as sugges

23条回答
  •  不思量自难忘°
    2020-12-02 04:09

    For Ubuntu:
    Happened with me when I updated docker.
    You need to unmask the service and socket and then restart the service.

    Following worked for me:

    systemctl unmask docker.service
    systemctl unmask docker.socket
    systemctl start docker.service
    

    What happend behind the scenes
    systemd also has the ability to mark a unit as completely unstartable, automatically or manually, by linking it to /dev/null. This is called masking the unit, and is possible with the mask command.

    sudo systemctl mask docker.service
    

    You can check the list of masked services using:

    sudo systemctl list-unit-files
    

    To enable auto/manual start of service you need to unmask it using:

    sudo sytemctl unmask docker.service
    

    Now the service will be enabled as shown below

提交回复
热议问题