dockerfile-maven-plugin_09
- 如图
- 代码:
- <properties>
- <java.version>1.8</java.version>
- <!--docker私服地址-->
- <docker.repostory>192...111:2375</docker.repostory>
- </properties>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>dockerfile-maven-plugin</artifactId>
- <version>1.4.10</version>
- <executions>
- <execution>
- </execution>
- <id>default</id>
- <goals>
- <!---部署的时候使用->
- <goal>push</goal>
- <!--如果package时不想用docker打包,就注释掉这个goal-->
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <repository>${docker.repostory}/${project.artifactId}</repository>
- <tag>${project.version}</tag>
- <buildArgs>
- <!--提供参数向Dockerfile传递-->
- <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
- </buildArgs>
- </configuration>
- </plugin>
- <plugin>
- </plugins>