This commit is contained in:
parent
c85e76cc26
commit
08d4161cad
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM openjdk:8
|
||||||
|
VOLUME /tmp
|
||||||
|
ADD scenic-1.0-SNAPSHOT.jar app.jar
|
||||||
|
EXPOSE 8081
|
||||||
|
ENTRYPOINT ["java","-jar","app.jar"]
|
24
run.sh
Normal file
24
run.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# 定义应用组名
|
||||||
|
group_name='xyy'
|
||||||
|
# 定义应用名称
|
||||||
|
app_name='init'
|
||||||
|
# 定义应用版本
|
||||||
|
app_version='latest'
|
||||||
|
# 定义应用环境
|
||||||
|
profile_active='dev'
|
||||||
|
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 0504:8081 --name ${app_name} \
|
||||||
|
-e TZ="Asia/Shanghai" \
|
||||||
|
-v /etc/localtime:/etc/localtime \
|
||||||
|
-d ${group_name}/${app_name}:${app_version}
|
||||||
|
echo '----start container----'
|
Loading…
Reference in New Issue
Block a user