Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Docker daemon on Ubuntu? [closed]

On Windows, I've always been able to build Docker images with no problems.

I'm now trying to build a simple Docker image on Ubuntu 18.04 and typing in the terminal:

sudo docker build -t test .

results in the following error:

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

How do I start the Docker daemon? I want to be able to build the image successfully

EDIT:

Typing sudo systemctl start docker as stated in the original documentation https://docs.docker.com/config/daemon/systemd/ results in the following error:

Failed to start docker.service: Unit docker.service is masked.
like image 260
Employee Avatar asked Feb 11 '19 12:02

Employee


People also ask

How do I turn on Docker daemon?

On MacOS go to the whale in the taskbar > Preferences > Daemon > Advanced. You can also start the Docker daemon manually and configure it using flags. This can be useful for troubleshooting problems. Many specific configuration options are discussed throughout the Docker documentation.


1 Answers

You can configure docker to start on boot :

sudo systemctl enable docker

The ugly way : start docker manually :

dockerd &
like image 174
Zak Avatar answered Oct 11 '22 14:10

Zak