Signed-off-by: gcalvino <guillermo.calvinosanchez@altran.com>
Change-Id: I43c529bfe160ed7fac032a6984ea8a3f3ea4606e
function deploy_lightweight() {
echo "Deploying lightweight build"
+ if [ "${DEFAULT_MTU}" != "1500" ]; then
+ DOCKER_NETS=`sg docker -c "docker network list" | awk '{print $2}' | egrep -v "^ID$" | paste -d " " -s`
+ DOCKER_GW_NET=`sg docker -c "docker network inspect ${DOCKER_NETS}" | grep Subnet | awk -F\" '{print $4}' | egrep "^172" | sort -u | tail -1 | awk -F\. '{if ($2 != 255) print $1"."$2+1"."$3"."$4; else print "-1";}'`
+ sg docker -c "docker network create --subnet ${DOCKER_GW_NET} --opt com.docker.network.bridge.name=docker_gwbridge --opt com.docker.network.bridge.enable_icc=false --opt com.docker.network.bridge.enable_ip_masquerade=true --opt com.docker.network.driver.mtu=${DEFAULT_MTU} docker_gwbridge"
+ fi
newgrp docker << EONG
docker swarm init --advertise-addr ${DEFAULT_IP}
docker network create --driver=overlay --attachable --opt com.docker.network.driver.mtu=${DEFAULT_MTU} netOSM