dex/go-docker

27 lines
679 B
Text
Raw Normal View History

2015-08-18 05:57:27 +05:30
#!/bin/bash -e
#
# USAGE:
#
# With env vars:
# MYVAR=foo OTHERVAR=bar DOCKER_ENV=MYVAR,OTHERVAR ./go-docker ./my-script --my-script-arg1 --my-script-arg2
#
# Without env vars:
# ./go-docker ./my-script --my-script-arg1 --my-script-arg2
REPO=github.com/coreos/dex
# forward whitelisted env variables to docker
ENV_STR=""
for VAR in ${DOCKER_ENV//,/ }; do
ENV_STR="$ENV_STR -e $VAR=${!VAR}"
done
LINKS_STR=""
for VAR in ${DOCKER_LINKS//,/ }; do
LINKS_STR="$LINKS_STR --link $VAR"
done
2015-08-18 05:57:27 +05:30
echo "running with docker, might take a while to pull the image..."
2015-10-23 02:31:41 +05:30
docker run $LINKS_STR $ENV_STR --rm -v `pwd`:/go/src/$REPO -w /go/src/$REPO quay.io/coreos/dex-builder:1.4 $@