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
  • 2,841
  • 3
  • 25
  • 48

1 Answers1

11

You can configure docker to start on boot :

sudo systemctl enable docker

The ugly way : start docker manually :

dockerd &
Zak
  • 925
  • 9
  • 22