Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 Spring Boot 项目,然后给项目添加 Docker 支持,最后对项目进行部署。一个简单 Spring Boot 项目在 pom.xml 中 ,使用 Spring Boot 2.0 相关依赖parent> groupId>org.springframework.bootgroupId> artifactId>spring-boot-starter-parentartifactId> version>2.0.0.RELEASEversion>parent>添加 web 和测试依赖dependencies> dependency> groupId>org.springframework.bootgroupId> artifactId>spring-boot-starter-webartifactId> dependency> dependency> groupId>org.springframework.bootgroupId> artifactId>spring-boot-starter-testartifactId> scope>testscope> dependency>dependencies>创建一个 DockerController,在其中有一个index()方法,访问时返回:Hello
………………………………