问题描述
我们一直在努力尝试使用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 (将#修改为@)