2024-08-13 14:36:48 +08:00
|
|
|
app_name='ludu-job-admin'
|
|
|
|
# 定义应用版本
|
|
|
|
app_version='1.0.0'
|
|
|
|
# 定义应用环境
|
|
|
|
#profile_active='prod'
|
2024-10-28 16:12:08 +08:00
|
|
|
# 打包编译docker镜像
|
|
|
|
echo '----build image----'
|
|
|
|
docker buildx build -f Dockerfile -t ${app_name}:${app_version} .
|
2024-08-13 14:36:48 +08:00
|
|
|
echo '----stop container----'
|
|
|
|
docker stop ${app_name}
|
|
|
|
echo '----rm container----'
|
|
|
|
docker rm ${app_name}
|
2024-10-28 16:12:08 +08:00
|
|
|
echo '----rmi none image----'
|
|
|
|
docker rmi $(docker images -f "dangling=true" -q)
|
2024-08-13 14:36:48 +08:00
|
|
|
echo '----start container----'
|
2024-10-29 17:37:10 +08:00
|
|
|
docker run -d -p 48083:9090 --name ${app_name} --restart always ${app_name}:${app_version}
|