This repository has been archived on 2022-08-17. You can view files and clone it, but cannot push or open issues or pull requests.
dex/go-docker
Bobby Rullo 91b900db3b go-docker: support functional tests
* add linking to go-docker command and remove host networking
* add functional/repo to functional tests script
2015-08-20 16:50:30 -07:00

26 lines
680 B
Bash
Executable file

#!/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
echo "running with docker, might take a while to pull the image..."
docker run $LINKS_STR $ENV_STR --rm -v `pwd`:/go/src/$REPO -w /go/src/$REPO quay.io/coreos/go-builder:1.3.3 $@