-
-
Save diegovillacis10/77cbd02ee3c1d971f7681e012333af2e to your computer and use it in GitHub Desktop.
Tired of running `eval "$(docker-machine env host)"` every time? Just paste this in .bashrc / .zshrc. This script automatically sets environment variables for one of running host machines in Docker Machine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check if `docker-machine` command exists | |
if command -v docker-machine > /dev/null; then | |
local machine_name=default | |
local machine_status=$(docker-machine status $machine_name) | |
if [ "$machine_status" = "Running" ]; then | |
eval "$(docker-machine env $machine_name)" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment