16 lines
549 B
Bash
16 lines
549 B
Bash
|
#!/bin/bash
|
||
|
app_name='zymall'
|
||
|
# 定义应用版本
|
||
|
app_version='1.0.0'
|
||
|
# 定义应用环境
|
||
|
# 打包编译docker镜像
|
||
|
echo '----build image----'
|
||
|
docker buildx build -f Dockerfile -t "${app_name}:${app_version}" .
|
||
|
echo '----stop container----'
|
||
|
docker stop ${app_name}
|
||
|
echo '----rm container----'
|
||
|
docker rm ${app_name}
|
||
|
echo '----rmi none image----'
|
||
|
docker rmi $(docker images -f "dangling=true" -q)
|
||
|
echo '----start container----'
|
||
|
docker run -d -p 6127:6127 --name ${app_name} -v /home/mallpic:/home/mallpic --restart always ${app_name}:${app_version}
|