From 8d1c44f1482be4ab21ed3c0f62ca5be49afb0b88 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 4 Jan 2016 16:32:12 -0800 Subject: [PATCH] Fix broken daemon startup with master Since the daemon flag was deprecated and replaced by the daemon subcommand, the run engine should use the subcommand and only the flag for older versions Signed-off-by: Derek McGowan (github: dmcgowan) --- contrib/docker-integration/run.sh | 2 +- contrib/docker-integration/run_engine.sh | 12 ++++++++++-- contrib/docker-integration/run_multiversion.sh | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/contrib/docker-integration/run.sh b/contrib/docker-integration/run.sh index 87dfa6301..c8831a099 100755 --- a/contrib/docker-integration/run.sh +++ b/contrib/docker-integration/run.sh @@ -38,13 +38,13 @@ docker pull $INTEGRATION_IMAGE ID=$(docker run -d -it --privileged $volumeMount $dockerMount \ -v ${DISTRIBUTION_ROOT}:/go/src/github.com/docker/distribution \ -e "DOCKER_GRAPHDRIVER=$DOCKER_GRAPHDRIVER" \ - -e "EXEC_DRIVER=$EXEC_DRIVER" \ ${INTEGRATION_IMAGE} \ ./run_engine.sh) # Stop container on exit trap "docker rm -f -v $ID" EXIT + # Wait for it to become reachable. tries=10 until docker exec "$ID" docker version &> /dev/null; do diff --git a/contrib/docker-integration/run_engine.sh b/contrib/docker-integration/run_engine.sh index 4a7b94e02..d14384cfe 100755 --- a/contrib/docker-integration/run_engine.sh +++ b/contrib/docker-integration/run_engine.sh @@ -11,5 +11,13 @@ echo "$IP localregistry" >> /etc/hosts sh install_certs.sh localregistry -docker --daemon --log-level=panic \ - --storage-driver="$DOCKER_GRAPHDRIVER" --exec-driver="$EXEC_DRIVER" +DOCKER_VERSION=$(docker --version | cut -d ' ' -f3 | cut -d ',' -f1) +major=$(echo "$DOCKER_VERSION"| cut -d '.' -f1) +minor=$(echo "$DOCKER_VERSION"| cut -d '.' -f2) + +daemonOpts="daemon" +if [ $major -le 1 ] && [ $minor -lt 9 ]; then + daemonOpts="--daemon" +fi + +docker $daemonOpts --log-level=debug --storage-driver="$DOCKER_GRAPHDRIVER" diff --git a/contrib/docker-integration/run_multiversion.sh b/contrib/docker-integration/run_multiversion.sh index c6da03140..73a70c7e8 100755 --- a/contrib/docker-integration/run_multiversion.sh +++ b/contrib/docker-integration/run_multiversion.sh @@ -23,7 +23,7 @@ fi # Released versions -versions="1.6.0 1.6.1 1.7.0 1.7.1" +versions="1.6.1 1.7.1 1.8.3 1.9.1" for v in $versions; do echo "Extracting Docker $v from dind image"