When working with docker toolbox, sometimes I type get tripped up trying to type docker-machine env default
and accidentally type docker machine env default instead. This bash script is a helper to allow you to do just that.
Put it in your $PATH and chmod +x my-docker. Then create an alias in your profile with alias docker="my-docker"
Now when you type docker machine env this will automatically proxy anything after machine to docker-machine.
Same goes for docker compose up proxies to docker-compose up.
To be safe (and shorten the code), you should consider using something like this on line 25:
docker ps -aq -f "status=exited"It doesn't depend on the possibly changing docker output and will also not catch container named Exited (strange but possible! :)