From 52cff6fb5d7445ad0820a988491ab804672f42c9 Mon Sep 17 00:00:00 2001 From: JuanJo Ciarlante Date: Thu, 10 May 2018 10:10:47 -0300 Subject: [PATCH] [jjo] apb-docker-run.sh: support $KUBECONFIG, fixes #287 (#288) --- scripts/apb-docker-run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/apb-docker-run.sh b/scripts/apb-docker-run.sh index 2d75b19..5d18ed7 100755 --- a/scripts/apb-docker-run.sh +++ b/scripts/apb-docker-run.sh @@ -15,6 +15,8 @@ if ! [[ -z "${DOCKER_CERT_PATH}" ]] && [[ ${DOCKER_CERT_PATH} = *"minishift"* ]] echo "Targetting minishift host: ${DOCKER_HOST}" fi +KUBECONFIG_ENV="${KUBECONFIG:+-v ${KUBECONFIG}:${KUBECONFIG} -e KUBECONFIG=${KUBECONFIG}}" + if [[ $IS_MINISHIFT = true ]]; then # If targetting minishift, there are some unique issues with using the apb # container. Need to capture the minishift docker-env vars, unset them for the @@ -40,10 +42,12 @@ if [[ $IS_MINISHIFT = true ]]; then -e DOCKER_HOST="${MINISHIFT_DOCKER_HOST}" \ -e DOCKER_CERT_PATH="${MINISHIFT_DOCKER_CERT_DEST}" \ -e MINISHIFT_REGISTRY=$(minishift openshift registry) \ + ${KUBECONFIG_ENV} \ -u $UID $APB_IMAGE "$@" else docker run --rm --privileged \ -v $PWD:/mnt -v $HOME/.kube:/.kube \ -v /var/run/docker.sock:/var/run/docker.sock \ + ${KUBECONFIG_ENV} \ -u $UID $APB_IMAGE "$@" fi