From 2ea61dc04fcdba86a296c348dc35b98c6acf4d11 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 30 Mar 2016 16:07:22 -0700 Subject: [PATCH] Add temporary cache directory Signed-off-by: Derek McGowan (github: dmcgowan) --- contrib/docker-integration/Dockerfile | 2 ++ contrib/docker-integration/run_multiversion.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/docker-integration/Dockerfile b/contrib/docker-integration/Dockerfile index 325a2251..7a047a68 100644 --- a/contrib/docker-integration/Dockerfile +++ b/contrib/docker-integration/Dockerfile @@ -4,4 +4,6 @@ MAINTAINER Docker Distribution Team RUN apk add --no-cache git +ENV TMPDIR /var/lib/docker/tmp + WORKDIR /go/src/github.com/docker/distribution/contrib/docker-integration diff --git a/contrib/docker-integration/run_multiversion.sh b/contrib/docker-integration/run_multiversion.sh index e85e99fd..35c2006e 100755 --- a/contrib/docker-integration/run_multiversion.sh +++ b/contrib/docker-integration/run_multiversion.sh @@ -7,6 +7,14 @@ set -x DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) + +if [ "$TMPDIR" != "" ] && [ ! -d "$TMPDIR" ]; then + mkdir -p $TMPDIR +fi + +cachedir=`mktemp -t -d golem-cache.XXXXXX` +trap "rm -rf $cachedir" EXIT + if [ "$1" == "-d" ]; then # Drivers to use for Docker engines the tests are going to create. STORAGE_DRIVER=${STORAGE_DRIVER:-overlay} @@ -47,7 +55,7 @@ time docker pull docker:1.9.1-dind time docker pull docker:1.10.3-dind time docker pull dockerswarm/dind:1.11.0-rc2 -golem \ +golem -cache $cachedir \ -i "golem-distribution:latest,$distimage,$distversion" \ -i "golem-dind:latest,docker:1.9.1-dind,1.9.1" \ -i "golem-dind:latest,docker:1.10.3-dind,1.10.3" \