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.
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.
You can configure docker to start on boot :
sudo systemctl enable docker
The ugly way : start docker manually :
dockerd &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With