In playing with Docker on various cloud providers I thought it would be nice to add the current docker host info the the prompt. First I created a function in my .bashrc
to set the docker environment variables from machine.
dme(){ eval $(docker-machine env $@) }
Then created another function and added it to PS1
to show the currently active machine. Here it is in action:
[ ~ ]$ dme default
[{🐳 default: 192.168.99.100} ~ ]$ dme default2
[{🐳 default2: 192.168.99.101} ~ ]$
Enjoy!