Merge pull request #815 from aaronlehmann/docker-integration-fixes

Two fixes for Docker integration tests
This commit is contained in:
Richard Scothern 2015-08-04 11:56:15 -07:00
commit 2e7ac2ec62
2 changed files with 24 additions and 1 deletions

View file

@ -20,7 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Docker # Install Docker
ENV VERSION 1.7.0-rc1 ENV VERSION 1.7.1
RUN curl -L -o /usr/local/bin/docker https://test.docker.com/builds/Linux/x86_64/docker-${VERSION} \ RUN curl -L -o /usr/local/bin/docker https://test.docker.com/builds/Linux/x86_64/docker-${VERSION} \
&& chmod +x /usr/local/bin/docker && chmod +x /usr/local/bin/docker

View file

@ -10,6 +10,29 @@ tmpdir_template="`pwd`/docker-versions.XXXXX"
tmpdir=`mktemp -d "$tmpdir_template"` tmpdir=`mktemp -d "$tmpdir_template"`
trap "rm -rf $tmpdir" EXIT trap "rm -rf $tmpdir" EXIT
if [ "$1" == "-d" ]; then
# Start docker daemon
# Drivers to use for Docker engines the tests are going to create.
STORAGE_DRIVER=${STORAGE_DRIVER:-overlay}
EXEC_DRIVER=${EXEC_DRIVER:-native}
docker --daemon --log-level=panic \
--storage-driver="$STORAGE_DRIVER" --exec-driver="$EXEC_DRIVER" &
DOCKER_PID=$!
# Wait for it to become reachable.
tries=10
until docker version &> /dev/null; do
(( tries-- ))
if [ $tries -le 0 ]; then
echo >&2 "error: daemon failed to start"
exit 1
fi
sleep 1
done
fi
# If DOCKER_VOLUME is unset, create a temporary directory to cache containers # If DOCKER_VOLUME is unset, create a temporary directory to cache containers
# between runs # between runs
# Only do this on Linux, because using /var/lib/docker from a host volume seems # Only do this on Linux, because using /var/lib/docker from a host volume seems