Docker 图像未从 pom.xml 获取图像名称

Nis*_*ney 1 docker spring-boot spotify-docker-client docker-maven-plugin

我正在使用 spotify 创建 docker 图像。我的 docker 镜像创建成功,但没有 oa 名称。我在控制台下面:

图像将在没有名称的情况下构建

POM文件

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.nv</groupId>
    <artifactId>microeurekaserver</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>MicroEurekaServer</name>
    <description>Eureka Server</description>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Finchley.SR2</spring-cloud.version>
        <docker.image.prefix>nvarshney44/nvarshney</docker.image.prefix>
    </properties>


  <build>
     <plugins>
       <plugin>
         <groupId>com.spotify</groupId>
         <artifactId>docker-maven-plugin</artifactId>
         <version>1.0.0</version>

         <configuration>
            <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
            <forceTags>true</forceTags>
            <imageTags>
                <imageTag>${project.version}</imageTag>
                <imageTag>latest</imageTag>
             </imageTags>
            <resources>
               <resource>
                  <directory>${project.build.directory}</directory>
                  <include>${project.build.finalName}.jar</include>
               </resource>
            </resources>
            <serverId>docker-hub</serverId>
             <registryUrl>https://index.docker.io/v1/</registryUrl>
         </configuration>
      </plugin>

      <plugin>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
   </plugins>

</build>
Run Code Online (Sandbox Code Playgroud)

Maven 输出

请帮我看看它有什么问题。在 maven 输出中,它显示 dockerfile:null 可能是因为它正在花费一些问题。

Omr*_*tor 8

为了给一个 Docker 镜像起一个名字,你需要填写“repository”字段:

<configuration>
  <repository>your-name-here</repository> <!-- ${project.artifactId} is a good choice -->
  <tag>${project.version}</tag>
</configuration>
Run Code Online (Sandbox Code Playgroud)

这实际上与 Docker 推送的工作方式一致——它将名称视为存储库地址。