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
Post a Comment