如何使用fabric8 maven插件标记图像?

如何使用fabric8 maven插件标记图像?,maven,docker,spring-boot,fabric8,google-kubernetes-engine,Maven,Docker,Spring Boot,Fabric8,Google Kubernetes Engine,我想用fabric8 maven插件构建一个Docker映像,并将其推送到自定义注册表(gcr.io//demo123)。但是,maven插件总是使用项目的组/工件id来派生图像标记。我想我可以通过的标记手动配置标记,但这不起作用。。。有什么想法吗 执行maven目标fabric8:build会导致 [INFO] F8: Successfully tagged example/demo:snapshot-180210-220255-0223 [INFO] F8: [example/demo:sn

我想用fabric8 maven插件构建一个Docker映像,并将其推送到自定义注册表(
gcr.io//demo123
)。但是,maven插件总是使用项目的组/工件id来派生图像标记。我想我可以通过
标记手动配置标记,但这不起作用。。。有什么想法吗

执行maven目标
fabric8:build
会导致

[INFO] F8: Successfully tagged example/demo:snapshot-180210-220255-0223
[INFO] F8: [example/demo:snapshot-180210-220255-0223] "spring-boot": Built image sha256:003d6
[INFO] F8: [example/demo:snapshot-180210-220255-0223] "spring-boot": Tag with latest
这是我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>demo</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </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>3.5.33</version>
            <configuration>
                <verbose>true</verbose>
                <images>
                    <image>
                        <name>gcr.io/myid/demo123</name>
                    </image>
                </images>
            </configuration>
            <executions>
                <execution>
                    <id>fmp</id>
                    <goals>
                        <goal>resource</goal>
                        <goal>build</goal>
                        <goal>push</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

4.0.0
com.example

我在pom.xml中以这种方式进行了配置,并且成功了

```

buildprofile
io.fabric8
fabric8 maven插件
3.5.35
{image.user}/{image.name}:{image.tag}
资源
建造

```


我点击了mvn clean install-Pbuildprofile遇到了同样的问题。添加标签
build
修复了它。无法解释原因,也许其他人知道

<images>
  <image>
    <name>gcr.io/myid/demo123</name>
    <build></build>
  </image>
</images>

gcr.io/myid/demo123
<images>
  <image>
    <name>gcr.io/myid/demo123</name>
    <build></build>
  </image>
</images>