Using the Docker Golang SDK. How can I wait until the docker daemon is running?

So I found out there is a Golang SDK and I was wondering if it was possible to have a check that waits until the docker daemon is running. I want to create a CLI tool that will be started on boot, but I know that the docker daemon might not be running when this script is running.

Is it a case of checking for the /var/docker.sock file, or can I use a better way of checking if Docker is running? I also would like it to be a cross platform solution (linux and MacOS, windows is optional).

Any one got a idea how, or what I can use (maybe an example?).


BTW I know there is a Moby Community Forum, but that one seems to be kinda dead (no major/recent activity).