From ddbc3b2457a035f3ce50a90f6b1c912b7cd8d7f8 Mon Sep 17 00:00:00 2001 From: Ian Costanzo Date: Fri, 17 Dec 2021 10:02:19 -0800 Subject: [PATCH] Update docker scripts to use new & improved docker IP detection Signed-off-by: Ian Costanzo --- demo/run_bdd | 4 +++- demo/run_demo | 4 +++- docker/manage | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/demo/run_bdd b/demo/run_bdd index da898a79b2..a8306aa947 100755 --- a/demo/run_bdd +++ b/demo/run_bdd @@ -133,7 +133,9 @@ if [ ! -z "$DOCKERHOST" ]; then # provided via APPLICATION_URL environment variable export RUNMODE="docker" elif [ -z "${PWD_HOST_FQDN}" ]; then - DOCKERHOST=`docker run --rm --net=host eclipse/che-ip` + # getDockerHost; for details refer to https://github.com/bcgov/DITP-DevOps/tree/main/code/snippets#getdockerhost + . /dev/stdin <<<"$(cat <(curl -s --raw https://raw.githubusercontent.com/bcgov/DITP-DevOps/main/code/snippets/getDockerHost))" + export DOCKERHOST=$(getDockerHost) export RUNMODE="docker" else PWD_HOST="${PWD_HOST_FQDN}" diff --git a/demo/run_demo b/demo/run_demo index 8955c837c2..ce2c193804 100755 --- a/demo/run_demo +++ b/demo/run_demo @@ -153,7 +153,9 @@ if [ ! -z "$DOCKERHOST" ]; then # provided via APPLICATION_URL environment variable export RUNMODE="docker" elif [ -z "${PWD_HOST_FQDN}" ]; then - DOCKERHOST=`docker run --rm --net=host eclipse/che-ip` + # getDockerHost; for details refer to https://github.com/bcgov/DITP-DevOps/tree/main/code/snippets#getdockerhost + . /dev/stdin <<<"$(cat <(curl -s --raw https://raw.githubusercontent.com/bcgov/DITP-DevOps/main/code/snippets/getDockerHost))" + export DOCKERHOST=$(getDockerHost) export RUNMODE="docker" else PWD_HOST="${PWD_HOST_FQDN}" diff --git a/docker/manage b/docker/manage index 3fc8f70794..990a11f1a0 100755 --- a/docker/manage +++ b/docker/manage @@ -1,6 +1,8 @@ #!/bin/bash export MSYS_NO_PATHCONV=1 -export DOCKERHOST=${APPLICATION_URL-$(docker run --rm --net=host eclipse/che-ip)} +# getDockerHost; for details refer to https://github.com/bcgov/DITP-DevOps/tree/main/code/snippets#getdockerhost +. /dev/stdin <<<"$(cat <(curl -s --raw https://raw.githubusercontent.com/bcgov/DITP-DevOps/main/code/snippets/getDockerHost))" +export DOCKERHOST=$(getDockerHost) set -e SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)"