- use spring-boot 2.x
- https://shields.io/
- github source
- gitee source
- /actuator/health
- spring-boot-2.4.5-reference
- @ControllerAdvice
- Exceptions Process
- ResponseEntityExceptionHandler
- requestmapping
- mvc-sse
- hibernate_validator_reference
- https://docs.docker.com/compose/compose-file/compose-file-v3/#build
- https://hub.docker.com/_/openjdk
ns for nanoseconds
us for microseconds
ms for milliseconds
s for seconds
m for minutes
h for hours
d for days
mvn -Dmvn-arg=your param -DskipTests clean package -P test
-Dparam,-Pyour profile
mvn help:system
Displays a list of the platform details like system properties and environment variablesmvn help:help
Display help information on maven-help-plugin.Call mvn help:help -Ddetail=true -Dgoal= to display parameter details
- javamelody
- spring-restdocs
- templating-maven-plugin
- thymeleaf
- logback
- 先通过maven打包到target目录下
- 执行构建指令:
cd target;docker build -f ../Dockerfile -t netbuffer/spring-boot-demo:1.0 ../
(docker build -t netbuffer/spring-boot-demo:1.0 .
)
- docker run --rm -it -p 9100:9100 netbuffer/spring-boot-demo:1.0
- docker-compose up (使用docker-compose启动服务)
需要注册DockerHub身份,再docker login登录对应的Registry
- docker images 找到镜像ID
- docker tag 镜像ID 你的DockerHub账户名/spring-boot-demo:1.0 打tag
- docker push 你的DockerHub账户名/spring-boot-demo:1.0 推送到远程
已发布到DockerHub,可以直接运行以下指令测试 https://hub.docker.com/r/javawiki/spring-boot-demo
- docker pull javawiki/spring-boot-demo:1.0 拉取远程镜像
- docker run -it --rm javawiki/spring-boot-demo:1.0 运行远程镜像