-
Notifications
You must be signed in to change notification settings - Fork 190
/
run.sh
33 lines (29 loc) · 1011 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SERVER_NAME=lincms-web
#判断是否存在webnotebook容器
docker ps | grep lincms-web &> /dev/null
#如果不存在,则Remove
if [ $? -ne 0 ]
then
echo "${SERVER_NAME} container not exist continue.. "
else
echo "remove ${SERVER_NAME} container"
docker rm ${SERVER_NAME} -f
fi
docker images | grep registry.cn-hangzhou.aliyuncs.com/igeekfan/${SERVER_NAME} &> /dev/null
if [ $? -ne 0 ]
then
echo "image does not exist , continue..."
else
echo "image exists !!! remove it"
docker rmi --force registry.cn-hangzhou.aliyuncs.com/igeekfan/${SERVER_NAME}
fi
#从阿里云拉取刚刚push的镜像
docker pull registry.cn-hangzhou.aliyuncs.com/igeekfan/${SERVER_NAME}
sudo docker run --restart \
unless-stopped \
-p 5011:8080 \
-v /var/www/lin-cms-dotnetcore/wwwroot/:/app/wwwroot:rw \
-v /var/www/lin-cms-dotnetcore/appsettings.Production.json/:/app/appsettings.Production.json:rw \
--privileged=true \
--name ${SERVER_NAME} \
-d registry.cn-hangzhou.aliyuncs.com/igeekfan/${SERVER_NAME}