Skip to content

Instantly share code, notes, and snippets.

@subfuzion
Created March 25, 2016 15:18
Show Gist options
  • Save subfuzion/41b8e2b9eed34532f910 to your computer and use it in GitHub Desktop.
Save subfuzion/41b8e2b9eed34532f910 to your computer and use it in GitHub Desktop.
Docker Machine & Compose: Get IP and PORT
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