docker-machine prompt

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.

    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:} ~ ]$ dme default2
[{🐳 default2:} ~ ]$



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s