Created
March 25, 2016 15:18
-
-
Save subfuzion/41b8e2b9eed34532f910 to your computer and use it in GitHub Desktop.
Docker Machine & Compose: Get IP and PORT
This file contains 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
function addr { | |
service=$1 | |
containerport=$2 | |
file=${3:-"docker-compose.yml"} | |
echo $(docker-machine ip $(docker-machine active)):$(docker-compose -f $file port $service $containerport | cut -d ':' -f 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment