mirror of https://github.com/docker/docs.git
integration helpers: Fix concurrent calls to start_docker().
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
ac7fdeab6b
commit
9567185038
|
|
@ -59,14 +59,14 @@ function start_docker() {
|
||||||
local i
|
local i
|
||||||
|
|
||||||
# Start the engines.
|
# Start the engines.
|
||||||
for ((i=current; i < instances; i++)); do
|
for ((i=current; i < (current + instances); i++)); do
|
||||||
local port=$(($BASE_PORT + $i))
|
local port=$(($BASE_PORT + $i))
|
||||||
HOSTS[$i]=127.0.0.1:$port
|
HOSTS[$i]=127.0.0.1:$port
|
||||||
DOCKER_CONTAINERS[$i]=$(docker run -d --name node-$i -h node-$i --privileged -p 127.0.0.1:$port:$port -it ${DOCKER_IMAGE}:${DOCKER_VERSION} docker -d -H 0.0.0.0:$port "$@")
|
DOCKER_CONTAINERS[$i]=$(docker run -d --name node-$i -h node-$i --privileged -p 127.0.0.1:$port:$port -it ${DOCKER_IMAGE}:${DOCKER_VERSION} docker -d -H 0.0.0.0:$port "$@")
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait for the engines to be reachable.
|
# Wait for the engines to be reachable.
|
||||||
for ((i=current; i < instances; i++)); do
|
for ((i=current; i < (current + instances); i++)); do
|
||||||
wait_until_reachable ${HOSTS[$i]}
|
wait_until_reachable ${HOSTS[$i]}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue