Spring Boot 部署到docker
程序员文章站
2024-03-20 23:02:52
...
网上找了几种方法,都会报错,试了几次终于不报错了,下面是pom.xml
文件
注:
- 仓库配置为阿里源
- 91行为docker宿主机ip及端口
- 92行为dockerfile文件目录
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>aliyun</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<groupId>com.anxpp.demo</groupId>
<artifactId>docker</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>docker</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<docker.image.prefix>spring</docker.image.prefix>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerHost>http://47.93.88.3:23750</dockerHost>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
上一篇: pycharm管理数据库
下一篇: oracle 条件语句
推荐阅读
-
spring cloud+docker 部署
-
Spring Boot 部署到docker
-
Spring boot传统部署 博客分类: Java spring boottomcatdeploy
-
在Docker容器中运行Spring Boot应用 博客分类: spring bootspring
-
springCloud Finchley 微服务架构从入门到精通【十】Docker Maven插件部署项目
-
手把手教你用Spring Cloud和Docker构建微服务 博客分类: 互联网技术spring boot分布式
-
手把手教你用Spring Cloud和Docker构建微服务 博客分类: 互联网技术spring boot分布式
-
将Eureka客户端部署到Docker,并注册到Eureka注册中心
-
spring cloud版本升级记录(1)注册中心升级到Hoxton.SR12 博客分类: spring boot 实践笔记
-
spring cloud版本升级记录(1)注册中心升级到Hoxton.SR12 博客分类: spring boot 实践笔记