#!/bin/bash

# Allow specifying alternative docker versions
daemon_version=${DOCKER_VERSION-1.10}
client_version=${DOCKER_CLIENT_VERSION-${daemon_version}}

# Setup py.test runner command, using dind and client docker cointainers

set -ex

# Start new docker-in-docker container
if docker inspect --type container xd-docker-dind >/dev/null 2>/dev/null ; then
    docker rm -f xd-docker-dind
fi
docker run -d --privileged --name xd-docker-dind docker:${daemon_version}-dind

# Build docker client image
cat tests/integration/Dockerfile | \
    sed -e "s/\(FROM docker\):.*/\1:${client_version}/" \
	> tests/integration/Dockerfile.tmp
docker build -t xd-docker-integration-test -f tests/integration/Dockerfile.tmp .
rm tests/integration/Dockerfile.tmp

exec docker run -ti --rm --link xd-docker-dind:docker \
    -v $PWD:/src -w /src -e PYTHONPATH=/src \
    -e DOCKER_HOST=tcp://docker:2375 \
    xd-docker-integration-test \
    python3

Add shell script to do manual testing
Add shell script to do manual testing

Run ./manual-test.sh starts a fresh dind container, and a Python
container (linked to the dind container) which can be used for
testing (playing around) with XD-Docker.

Signed-off-by: Esben Haabendal <da90c138e4a9573086862393cde34fa33d74f6e5@haabendal.dk>
