<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${docker.registry.url}/blade/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
配置如上。从jenkins耗时看,性能有较大的提升
PS:jenkins使用可能遇到权限不足的报错
Permission denied
执行sudo usermod -aG docker jenkins后重启jenkins即可
这种方式需要在linux部署 jenkins 对么
扫一扫访问 Blade技术社区 移动端