Official docker is installed on this Mac El Capitan. While running a bash file, one of the commands is to start the docker daemon if it is not running:    [[ $(docker-machine status) == Stopped ]] && docker-machine start    eval $(docker-machine env)I am guessing it was not running because I got the below output which I was hoping the above code would handle gracefully. What needs to be done for that to happen?  Starting default...  (default) Check network to re-create if needed...  (default) Waiting for an IP...  Machine default was started.  Waiting for SSH to be available...  Detecting the provisioner...  Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.  Error checking TLS connection: Error checking and/or regenerating the certs:   There was an error validating certificates for host 192.168.99.100:2376: tls: DialWithDialer timed out  You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.  Be advised that this will trigger a Docker daemon restart which will stop running containers.  How ever running the script file the second time, all went well.
shell script to ensure Docker Daemon is running - Official docker on OSx
shell script;docker;output
Docker on OS X (or macOS as it's now called) runs inside a Linux virtual machine, usually using VirtualBox as the hypervisor.  So when you start docker using docker-machine start, it will take a little while for the virtual machine to and all of the services on it to start and become available.  So to work around this, you could do something like the following:[[ $(docker-machine status) == Stopped ]] && docker-machine startsleep 10eval $(docker-machine env)You may wish to adjust the value passed to sleep if this turns out to be too much or not enough time, as the amount of time it takes for your virtual machine to become available depends on the hardware on your OS X host as well as the virtual hardware allocated to the Docker guest.