Skip to content

Instantly share code, notes, and snippets.

@muka
Created October 16, 2018 04:51
Show Gist options
  • Save muka/cc76ee644530f67977b40db140f4eb04 to your computer and use it in GitHub Desktop.
Save muka/cc76ee644530f67977b40db140f4eb04 to your computer and use it in GitHub Desktop.
Extract the ip from a docker-compose set of container
NET_NAME="project_default"
NAME="nats"
IP=docker network inspect $NET_NAME | grep $NAME -A 3 | grep "IP" | grep -Po "([0-9]+.[0-9]+.[0-9]+.[0-9])"
echo $IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment