①、装备一个Springboot项目,这里自己搭建吧,很简单的。我截出我的Controller
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvuf6thgj30dw09vdg2.jpg)
Controller
②、将项目打包成jar包,并上传到linux上。
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvufbo4lj30bp06s3yt.jpg)
打包上传
③、创建Dockerfile并编辑
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvufi62cj308d03jmx8.jpg)
创建Dockerfile并编辑
#指定基础镜像 FROM openjdk:8-jre #将jar复制到容器的根目录下并改名 ADD docker.jar docker.jar #容器启动时执行的命令 ENTRYPOINT ["java","-jar","/docker.jar"]
④、使用build创建镜像
docker build -t docker_sp:1 .
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvufoq0ej30bl09g3zi.jpg)
创建镜像
⑤、创建容器并启动
docker run -d -p 8080:8080 --name docker_spt 876742fc41d3
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvufvddyj30eu05974v.jpg)
创建容器并启动
⑥、通过url访问controller
![docker使用Dockerfile启动Springboot项目](https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://tva1.sinaimg.cn/large/0080xEK2gy1gexvug3otwj30c204twej.jpg)
访问成功界面
最新评论
mat插件可以检测内存数据
标识接口?
序列化serializabel就是一个标识
就差一个MAC了
mark
除了预置sql查询字段,其他我竟然都没用过
可以,这个问题遇到过
mybatis多个参数: 1. 注解(最常用) 2. 转化为对象或MAP 3. 按顺序(这个最蠢,写的代码看得费劲) 单个参数需要注意得: 1.基本数据类型随便写 2.数组用array,l