7

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.
Employee
  • 3,109
  • 5
  • 31
  • 50

1 Answers1

12

You can configure docker to start on boot :

sudo systemctl enable docker

The ugly way : start docker manually :

dockerd &
Zak
  • 1,005
  • 10
  • 22