We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/bin/bash name=protal #判断是否容器存在 sudo docker ps -a | grep $name &> /dev/null #如果存在,关闭并删除该容器 if [ $? -eq 0 ] then echo $name" is up,we will stop and remove it!!!" docker stop $name docker rm $name else echo $name" is not up!!!" fi #判断是否镜像存在 sudo docker images | grep $name &> /dev/null #如果存在,删除该镜像 if [ $? -eq 0 ] then echo $name" image is existed,we will remove it!!!" docker rmi $(docker images | grep $name | awk "{print $3}") else echo $name" image is not existed!!!" fi docker build -t protal . docker run -itd --name protal -e "SPRING_PROFILES_ACTIVE=prod" -p 3579:3579 -v /opt/file:/opt/file protal
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: