Docker for Mac V Docker Machine: Dawn of Connection Validation?

My apologies if this isn’t the correct forum for this, but there aren’t many forums around for Docker for Mac. :wink: With Docker for Mac up and running and Docker Machine/VirtualBox running, what’s the best way to validate a Docker Machine VM has started and the client connection works properly?

One thing I’ve noticed since using Docker Machine is that it doesn’t always start up and allow docker commands to work properly the first time, even if docker-machine env set the vars properly. I wrote a script that would try and validate the DM VM connection was working and I used docker ps as a means to validate that connection. However, with Docker for Mac running, well, docker ps will always work so I can’t verify if my connection to the DM VM is successful.

Why would I do this? We have a tool that takes advantage of multiple DM VMs to have different versions of our suite of tools (minimum 9 services) ready to spin up. Using multiple VMs simplified the exposed port mapping so the difference between versions was the IP address.

I know the work around to my main question is to just quit Docker for Mac, but I’m hoping that someone more knowledgeable might have a better way to solve the DMVM + Docker for Mac connection validation issue.