How to start Docker daemon on Ubuntu? [closed]
Asked Answered
C

1

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.
Constringent answered 11/2, 2019 at 12:34 Comment(4)
docs.docker.com/config/daemon/systemdEcht
@Echt doing sudo systemctl start docker results in Failed to start docker.service: Unit docker.service is masked.Constringent
Check thisEcht
Try running the following : sudo systemctl unmask docker.service sudo systemctl unmask docker.socket sudo systemctl start docker.serviceVaquero
M
14

You can configure docker to start on boot :

sudo systemctl enable docker

The ugly way : start docker manually :

dockerd &
Manama answered 11/2, 2019 at 13:57 Comment(2)
dockerd & did the trick :DConstringent
Nice! Glad it worked.Manama

© 2022 - 2024 — McMap. All rights reserved.