diff options
author | drebs <drebs@leap.se> | 2016-05-30 13:45:51 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-06-06 21:40:37 -0300 |
commit | f829832457237b7342e510e4112f66819be3ab3d (patch) | |
tree | fc682e18c9a1926d1c1198bd54bfeb70d82f1d65 /scripts/docker/helper | |
parent | 3e4870f8bd6186f3d0821f392a0dafc5d5247ad4 (diff) |
[test] add files to create docker image
Diffstat (limited to 'scripts/docker/helper')
-rwxr-xr-x | scripts/docker/helper/get-container-ip.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/docker/helper/get-container-ip.sh b/scripts/docker/helper/get-container-ip.sh new file mode 100755 index 00000000..2b392350 --- /dev/null +++ b/scripts/docker/helper/get-container-ip.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Print the IP of a container to stdout, given its id. Check the output for +# the `docker inspect` commmand for more details: +# +# https://docs.docker.com/engine/reference/commandline/inspect/ + +if [ ${#} -ne 1 ]; then + echo "Usage: ${0} container_id" + exit 1 +fi + +container_id=${1} + +/usr/bin/docker \ + inspect \ + --format='{{.NetworkSettings.IPAddress}}' \ + ${container_id} |