Cannot set name of fabric8 image using maven plugin

335 views Asked by At

We've been trying very hard for a while to build and push an image using fabric8, however no matter what we do to name the image, it is always named the same thing.

Building and deploying the image works fine, and we have it running on an OKD cluster. However no matter what we do the name is always the default

best-practice/best-practice-java:1.0.0

Rather than what we think we're specifying

internal/best-practice/best-practice-java:1.0.0

We run the following command

mvn clean package fabric8:build fabric8:push

This is the 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>

0

There are 0 answers