mirror of https://github.com/docker/docs.git
use random port in mesos tests
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
49d475228e
commit
5a39d21707
|
@ -161,6 +161,7 @@ function start_docker() {
|
||||||
for ((i=current; i < (current + 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
|
||||||
|
PORTS[$i]=$port
|
||||||
|
|
||||||
# We have to manually call `hostname` since --hostname and --net cannot
|
# We have to manually call `hostname` since --hostname and --net cannot
|
||||||
# be used together.
|
# be used together.
|
||||||
|
|
|
@ -4,7 +4,6 @@ load ../helpers
|
||||||
|
|
||||||
MESOS_IMAGE=jimenez/mesos-dev:clang
|
MESOS_IMAGE=jimenez/mesos-dev:clang
|
||||||
MESOS_MASTER_PORT=$(( ( RANDOM % 1000 ) + 10000 ))
|
MESOS_MASTER_PORT=$(( ( RANDOM % 1000 ) + 10000 ))
|
||||||
BASE_PORT=2375
|
|
||||||
|
|
||||||
# Start mesos master and slave.
|
# Start mesos master and slave.
|
||||||
function start_mesos() {
|
function start_mesos() {
|
||||||
|
@ -17,9 +16,8 @@ function start_mesos() {
|
||||||
|
|
||||||
MESOS_SLAVE=$(
|
MESOS_SLAVE=$(
|
||||||
docker_host run --privileged -d --name mesos-slave --volumes-from node-0 -e DOCKER_HOST="${HOSTS[0]}" -v /sys/fs/cgroup:/sys/fs/cgroup --net=host \
|
docker_host run --privileged -d --name mesos-slave --volumes-from node-0 -e DOCKER_HOST="${HOSTS[0]}" -v /sys/fs/cgroup:/sys/fs/cgroup --net=host \
|
||||||
$MESOS_IMAGE /mesos/build/bin/mesos-slave.sh --master=127.0.0.1:$MESOS_MASTER_PORT --containerizers=docker --hostname=127.0.0.1 --port=$(($MESOS_MASTER_PORT + 1))
|
$MESOS_IMAGE /mesos/build/bin/mesos-slave.sh --master=127.0.0.1:$MESOS_MASTER_PORT --containerizers=docker --attributes="docker_port:${PORTS[0]}" --hostname=127.0.0.1 --port=$(($MESOS_MASTER_PORT + 1))
|
||||||
)
|
)
|
||||||
|
|
||||||
retry 10 1 eval "docker_host ps | grep 'mesos-slave'"
|
retry 10 1 eval "docker_host ps | grep 'mesos-slave'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue