上一篇讲了如何使用Docker发布镜像:Docker发布镜像
这篇进行升级完善,使用Jenkins达到WEB管理项目的发布。
思路:Jenkins可以当做是一个命令行脚本,Git用作拉取项目代码,Docker用作项目容器。
1. 先安装必要软件:
安装jdk
https://blog.csdn.net/small_love/article/details/77394721
安装maven
https://www.cnblogs.com/ningzijie/p/12832672.html
安装git
https://blog.csdn.net/javaee_sunny/article/details/80450153
安装jenkins
https://blog.csdn.net/sunhuwh/article/details/112469864
安装docker
https://blog.csdn.net/kuqq2005/article/details/76359327
2. pom.xml和Dockerfile
参照Docker发布镜像第2步、第3步完成项目对Docker的支持
3. 增加启动项目的命令start.sh
在pom.xml同级的目录下创建start.sh
appName="real_estate_analysis"
word="1"
echo "$word"
word=`docker ps -a -q --no-trunc --filter name=^/"$appName"$`
echo "$word"
if [ -z