2022-02-19 00:06:07 -05:00
|
|
|
#!/bin/sh
|
|
|
|
imageName="zerotier-planet"
|
|
|
|
|
2022-02-20 07:25:08 -05:00
|
|
|
|
2022-02-19 00:06:07 -05:00
|
|
|
echo "清除原有内容"
|
2022-02-20 07:25:08 -05:00
|
|
|
rm /opt/planet
|
2022-02-19 00:06:07 -05:00
|
|
|
docker stop $imageName
|
|
|
|
docker rm $imageName
|
|
|
|
docker rmi $imageName
|
|
|
|
|
2022-02-20 07:25:08 -05:00
|
|
|
|
2022-02-19 00:06:07 -05:00
|
|
|
echo "打包镜像"
|
2022-02-20 11:58:26 -05:00
|
|
|
docker build --network host -t $imageName .
|
2022-02-19 00:06:07 -05:00
|
|
|
|
|
|
|
echo "启动服务"
|
|
|
|
for i in $(lsof -i:9993 -t);do kill -2 $i;done
|
2022-02-20 11:58:26 -05:00
|
|
|
docker run -d --network host --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp --restart unless-stopped $imageName
|
2022-04-14 02:15:48 -04:00
|
|
|
docker cp zerotier-planet:/app/bin/planet /opt/planet
|