How do you detect that Docker for Windows is running, as opposed to boot2docker or Docker Machine?
On Mac, I test the presence of a
/var/run/docker.sock socket. But on Windows?
My ideas so far are:
- grep the output of
docker infoand test that the name is “moby”
- test connectivity to the Docker Engine API on localhost:2375
But I’m unsure if these could give false positives, especially the name test.