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