美文网首页
基于Fabric8将SpringBoot工程快速构建镜像并发布到

基于Fabric8将SpringBoot工程快速构建镜像并发布到

作者: 与诗小睡 | 来源:发表于2020-07-25 11:21 被阅读0次
<plugin>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric8-maven-plugin</artifactId>
      <version>${fabric8.maven.plugin.version}</version>
      <executions>
          <execution>
             <goals>
                <goal>resource</goal>
                <goal>build</goal>
                </goals>
            </execution>
     </executions>
                             
    </plugin>

发布:

mvn fabric8:deploy

xml高级配置:

 <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>fabric8-maven-plugin</artifactId>
                <version>${fabric8.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>resource</goal>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
     <!-- 自定义配置 -->
                <configuration>
                    <enricher>
                        <config>
                            <!-- k8s service 配置 将service开放类型改成NodePort  -->
                            <fmp-service>
                                <type>NodePort</type>
                            </fmp-service>
                        </config>
                    </enricher>
                    <images>
                        <image>
                            <!-- 自定义镜像名 -->
                            <name>lps/${project.artifactId}:${project.version}</name>
                        
                            <build>
                                <!-- 自定义基础镜像-->
                                <from>registry.lps.com/fabric-base-jdk8</from>
                                <!-- 自定义文件发布 比如将项目 a-jarwithdepences.jar发布到镜像目录/deployment / -->
                                <assembly>
                                    <descriptor>assembly.xml</descriptor>
                                    <targetDir>/deployments</targetDir>
                                </assembly>

                            </build>
                        </image>
                    </images>

                </configuration>
            </plugin>

image.png

相关文章

网友评论

      本文标题:基于Fabric8将SpringBoot工程快速构建镜像并发布到

      本文链接:https://www.haomeiwen.com/subject/zcuplktx.html