微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法使用Maven插件设置fabric8图像的名称

如何解决无法使用Maven插件设置fabric8图像的名称

我们一直在努力尝试使用fabric8构建和推送图像,但是无论我们如何命名该图像,它总是被命名为同一事物。

构建和部署映像可以正常工作,并且我们可以在OKD集群上运行它。但是,无论我们做什么,该名称始终是名称

best-practice / best-practice-java:1.0.0

不是我们认为的那样

内部/最佳实践/最佳实践java:1.0.0

我们运行以下命令

mvn clean package fabric8:build fabric8:push

这是pom

<?xml version="1.0" encoding="UTF-8"?>
<!--
    copyright 2016 Red Hat,Inc.
    Red Hat licenses this file to you under the Apache License,version
    2.0 (the "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
        http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing,software
    distributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or
    implied.  See the License for the specific language governing
    permissions and limitations under the License.
-->
<project>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>best-practice-java</artifactId>
    <groupId>com.example.best-practice</groupId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.3.RELEASE</version>
    </parent>

    <properties>
        <fabric8.mode>kubernetes</fabric8.mode>
        <fabric8.build.strategy>docker</fabric8.build.strategy>
        <docker.push.registry>artifactory.example.com</docker.push.registry>
        <docker.registry>artifactory.example.com</docker.registry>
        <docker.url>https://artifactory.example.com</docker.url>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vlkan.log4j2</groupId>
            <artifactId>log4j2-logstash-layout</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>fabric8-maven-plugin</artifactId>
                <version>4.2.0</version>
                <configuration>
                    <generateRoute>true</generateRoute>
                    <images>
                        <image>
                            <name>{docker.push.registry}/internal/%g/%a:%v</name>
                        </image>
                    </images>
                    <enricher>
                        <config>
                            <fmp-controller>
                                <pullPolicy>Always</pullPolicy>
                            </fmp-controller>
                            <!-- Health check on the Spring Boot Actuator -->
                            <f8-healthcheck-spring-boot>
                                <timeoutSeconds>5</timeoutSeconds>
                                <readinessProbeInitialDelaySeconds>20</readinessProbeInitialDelaySeconds>
                                <failureThreshold>3</failureThreshold>
                                <successthreshold>1</successthreshold>
                            </f8-healthcheck-spring-boot>
                        </config>
                    </enricher>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?