diff --git a/modules/README.md b/modules/README.md index 2a49804c..38c35265 100644 --- a/modules/README.md +++ b/modules/README.md @@ -31,6 +31,11 @@ DNF Defines dnf aliases. +Docker +--- + +Sets the environment variables to work with docker through boot2docker + Dpkg ---- diff --git a/modules/docker/README.md b/modules/docker/README.md new file mode 100644 index 00000000..68c509a5 --- /dev/null +++ b/modules/docker/README.md @@ -0,0 +1,15 @@ +Docker +====== + +Sets the environment variables to work with [docker][1] through [boot2docker][2] + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][3].* + + - [Pavel Chernykh](https://github.com/pavel-v-chernykh) + +[1]: http://docker.io/ +[2]: http://boot2docker.io/ +[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/docker/init.zsh b/modules/docker/init.zsh new file mode 100644 index 00000000..2d5877b2 --- /dev/null +++ b/modules/docker/init.zsh @@ -0,0 +1,20 @@ +# +# Sets the environment variables to work with docker through boot2docker +# +# Authors: +# Pavel Chernykh +# + +# +# Return if requirements are not found. +# +if (( !( $+commands[docker] && $+commands[boot2docker]) )); then + return 1 +fi + +# +# Set the environment variables if boot2docker is running +# +if [[ `boot2docker status` == "running" ]]; then + eval `boot2docker shellinit 2> /dev/null` +fi