Closed vieyahn2017 closed 5 years ago
#!/bin/bash
docker pull 10.183.118.211:5000/dj_simu:V3R2C10_001
docker ps -a | grep "10.183.118.211:5000/dj_simu:V3R2C10_001" |awk '{print $1}'|xargs docker rm -f {}
ipaddr=`ifconfig eth0 |grep "inet addr"| cut -f 2 -d ":"|cut -f 1 -d " "`
index=0
while [ $index != $1 ]
do
j=`expr 42001 + $index \* 2`
k=`expr 42002 + $index \* 2`
docker run -d -p $j:8088 -p $k:22 10.183.118.211:5000/dj_simu:V3R2C10_001 sh /home/start.sh $ipaddr $j &
echo docker run -d -p $j:8088 -p $k:22 10.183.118.211:5000/dj_simu:V3R2C10_001 sh /home/start.sh $ipaddr $j &
index=`expr $index + 1`
#sleep 10
done
# 本机ip
host_ip=`ifconfig | grep "inet " | awk '{print $2}' | grep -v "127.0.0.1" | xargs | tr ' ' ','`
ifconfig eth0 | grep "inet addr"| cut -f 2 -d ":"| cut -f 1 -d " "