How can I detect if docker for mac is installed?

JE42 picture JE42 · Jul 6, 2016 · Viewed 9.4k times · Source

I have some makefiles where most of the stuff should run without configuration. These makefiles have used docker-machine in the past.

Is there a way to detect in bash if the user is using docker desktop for mac instead of docker-machine ?

Answer

nikolay picture nikolay · Oct 25, 2016

The cleanest way I found so far is:

[[ $(docker version --format "{{.Server.KernelVersion}}") == *-moby ]]