Skip to content

Commit

Permalink
[jjo] apb-docker-run.sh: support $KUBECONFIG, fixes #287 (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjo authored and dymurray committed May 10, 2018
1 parent da5cdba commit 52cff6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/apb-docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 52cff6f

Please sign in to comment.