Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
- My setup: Ubuntu 22.04, Terraform, Docker Desktop
When you try to follow the first tutorial at Terraform and do terraform apply
you get the message above. It tooks me a couple of hours to discover that Docker Desktop in Ubuntu 22.04 don't use unix:///var/run/docker.sock as DOCKER ENDPOINT but unix:///home/user/.docker/desktop/docker.sock so the solution that works is this:
- Check your DOCKER ENDPOINT opening a terminal and typing:
docker context ls