I’m working through the official Terraform + Docker provider tutorial (on a Mac), and seeing this error when running terraform plan
(or apply
):
Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I’ve followed the rest of the instructions, Docker Desktop is running, docker ps
shows:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Without Docker Desktop running, it looks like the sock is in a different location?
Cannot connect to the Docker daemon at unix:///Users/{username}/.docker/run/docker.sock. Is the docker daemon running?
There are a handful of similar issues posted to Stack Overflow, some of which talk about using sudo
(which I’d rather not do), and others talk about creating a new docker
group with various command-line incantations to include the user account in the new docker
group.
I’m curious if anyone here has run into this recently, and what an “official” workaround or solution might be?
Thanks,
-Eric