Fix mismatched version error on integration tests

When running a different version of docker outside of the default in the integration image, then commands will fail with mismatched version unless the docker binary is specified to the correct version.

Add various cleanups to run script.
Run all commands interacting with docker inside the container in an exec.
Remove port binding to outside of container since all commands run inside.
Trap docker rm to exit in case of failure which prevents final command from running.
Do no copy images when $DOCKER_VOLUME is specified, this allows for faster runs when mounting a volume with a warm image cache.
Move exec and graph driver defaulting into run engine script.
Remove duplicated update of /etc/hosts.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2015-08-17 17:00:58 -07:00
parent 77c6d9deb9
commit 1a6949134e
3 changed files with 23 additions and 29 deletions

View file

@ -2,11 +2,14 @@
set -e
set -x
DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-overlay}
EXEC_DRIVER=${EXEC_DRIVER:-native}
# Set IP address in /etc/hosts for localregistry
IP=$(ifconfig eth0|grep "inet addr:"| cut -d: -f2 | awk '{ print $1}')
echo "$IP localregistry" >> /etc/hosts
sh install_certs.sh localregistry
docker --daemon -H "0.0.0.0:$ENGINE_PORT" --log-level=panic \
docker --daemon --log-level=panic \
--storage-driver="$DOCKER_GRAPHDRIVER" --exec-driver="$EXEC_DRIVER"