Scott Baker | 7a32759 | 2016-06-20 17:34:06 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
2 | |||||
3 | MODE=`docker inspect --format '{{ .HostConfig.NetworkMode }}' $1 | tr -d '\n' | tr -d '\r'` | ||||
4 | if [[ "$MODE" == "host" ]]; then | ||||
5 | echo -n "127.0.0.1" | ||||
6 | else | ||||
7 | docker inspect --format '{{ .NetworkSettings.IPAddress }}' $1 | tr -d '\n' | tr -d '\r' | ||||
8 | fi | ||||
9 |