mirror of
https://github.com/xubiaolin/docker-zerotier-planet.git
synced 2025-01-22 12:48:14 -05:00
修复无法互相ping的bug'
This commit is contained in:
parent
2c413ed4e7
commit
10c96569f1
@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
imageName="zerotier-planet"
|
||||
|
||||
docker network create zerotier
|
||||
|
||||
echo "清除原有内容"
|
||||
rm /opt/planet
|
||||
@ -11,11 +10,11 @@ docker rmi $imageName
|
||||
|
||||
|
||||
echo "打包镜像"
|
||||
docker build --network zerotier -t $imageName .
|
||||
docker build --network host -t $imageName .
|
||||
|
||||
echo "启动服务"
|
||||
for i in $(lsof -i:9993 -t);do kill -2 $i;done
|
||||
docker run -d --network zerotier --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp --dns 223.5.5.5 --dns 223.6.6.6 --restart unless-stopped $imageName
|
||||
docker run -d --network host --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp --restart unless-stopped $imageName
|
||||
|
||||
sleep 10s
|
||||
echo "生成世界"
|
||||
@ -23,4 +22,4 @@ docker exec -it $imageName sh /app/gen_world.sh
|
||||
docker cp $imageName:/opt/ZeroTierOne/attic/world/world.bin /opt/planet
|
||||
|
||||
echo "------------------"
|
||||
echo "现在已经配置好了,planet文件在/opt/planet, 客户端连接时需要替换该planet"
|
||||
echo "现在已经配置好了,planet文件在/opt/planet, 客户端连接时需要替换该planet"
|
||||
|
@ -7,4 +7,8 @@ cd /var/lib/zerotier-one && zerotier-idtool genmoon moon.json && mkdir moons.d &
|
||||
# 生成世界
|
||||
cd /opt/ZeroTierOne/attic/world/
|
||||
sh build.sh
|
||||
./mkworld
|
||||
sleep 5s
|
||||
./mkworld
|
||||
|
||||
ps -ef |grep 'zerotier-one -d' |grep -v grep |awk '{print $1}' |xargs kill -9
|
||||
zerotier-one -d
|
Loading…
Reference in New Issue
Block a user