Add support for docker volume
Added an environment variable which can be used to pass in the docker volume for the container. This allows caching the pulled images between runs, preventing unnecessary image pulls. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
de638db71e
commit
4ebd6b7e1d
2 changed files with 15 additions and 4 deletions
|
@ -6,6 +6,11 @@ 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
|
||||
|
||||
# Image containing the integration tests environment.
|
||||
INTEGRATION_IMAGE=${INTEGRATION_IMAGE:-distribution/docker-integration}
|
||||
|
||||
|
@ -14,9 +19,8 @@ INTEGRATION_IMAGE=${INTEGRATION_IMAGE:-distribution/docker-integration}
|
|||
#docker pull $INTEGRATION_IMAGE
|
||||
|
||||
# Start the integration tests in a Docker container.
|
||||
ID=$(docker run -d -t --privileged \
|
||||
ID=$(docker run -d -t --privileged $volumeMount \
|
||||
-v ${DISTRIBUTION_ROOT}:/go/src/github.com/docker/distribution \
|
||||
-e "DOCKER_IMAGE=$DOCKER_IMAGE" \
|
||||
-e "DOCKER_VERSION=$DOCKER_VERSION" \
|
||||
-e "STORAGE_DRIVER=$STORAGE_DRIVER" \
|
||||
-e "EXEC_DRIVER=$EXEC_DRIVER" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue