26 lines
681 B
Bash
26 lines
681 B
Bash
#!/bin/sh
|
||
# 定义应用组名
|
||
group_name='nnzmr'
|
||
# 定义应用名称
|
||
app_name='game'
|
||
# 定义应用版本
|
||
app_version='latest'
|
||
echo '----copy jar----'
|
||
docker stop ${app_name}
|
||
echo '----stop container----'
|
||
docker rm ${app_name}
|
||
echo '----rm container----'
|
||
docker rmi ${group_name}/${app_name}:${app_version}
|
||
echo '----rm image----'
|
||
# 打包编译docker镜像
|
||
docker build -t ${group_name}/${app_name}:${app_version} .
|
||
echo '----build image----'
|
||
docker run -p 8090:8090 --name ${app_name} \
|
||
-e TZ="Asia/Shanghai" \
|
||
-v /etc/localtime:/etc/localtime \
|
||
-d ${group_name}/${app_name}:${app_version}
|
||
echo '----start container----'
|
||
|
||
|
||
# 链接:https://juejin.cn/post/7153173983335022605
|