How can I detect if docker for mac is installed? -


i have makefiles of stuff should run without configuration. these makefiles have used docker-machine in past.

is there away detect in bash if user using docker mac instead of docker-machine ?

the best way check existence of docker environment variables:

  • docker_host
  • docker_machine_name
  • docker_tls_verify
  • docker_cert_path

all 4 of these set when eval $(docker-machine env) run , required use docker-machine.

the beta not require of them being set , in fact requires unset them in order function properly.


you can check in docker info command looking "moby" (the name of docker mac vm):

docker info | grep -q moby && echo "docker mac beta" || echo "not docker mac beta" 

this going dependent on consistency in docker info results, however.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -