distribution/contrib/docker-integration/run.sh
Aaron Lehmann a6346d64a1 Two more Docker integration test fixes
- Upgrade docker-compose to 1.3.3 to work around
  https://github.com/docker/compose/issues/1314

- Change run.sh to run the Docker container in the foreground so that
  the exit code is propagated.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-04 13:28:03 -07:00

32 lines
880 B
Bash
Executable File

#!/usr/bin/env bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# Root directory of Distribution
DISTRIBUTION_ROOT=$(cd ../..; pwd -P)
volumeMount=""
if [ "$DOCKER_VOLUME" != "" ]; then
volumeMount="-v ${DOCKER_VOLUME}:/var/lib/docker"
fi
dockerMount=""
if [ "$DOCKER_BINARY" != "" ]; then
dockerMount="-v ${DOCKER_BINARY}:/usr/local/bin/docker"
fi
# Image containing the integration tests environment.
INTEGRATION_IMAGE=${INTEGRATION_IMAGE:-distribution/docker-integration}
# Make sure we upgrade the integration environment.
docker pull $INTEGRATION_IMAGE
# Start the integration tests in a Docker container.
docker run --rm -t --privileged $volumeMount $dockerMount \
-v ${DISTRIBUTION_ROOT}:/go/src/github.com/docker/distribution \
-e "STORAGE_DRIVER=$DOCKER_GRAPHDRIVER" \
-e "EXEC_DRIVER=$EXEC_DRIVER" \
${INTEGRATION_IMAGE} \
./test_runner.sh "$@"