使用 maven 插件构建 docker 镜像时出错

时间:2021-04-21 13:17:57

标签: docker maven dockerfile-maven-plugin

我正在尝试使用 maven 插件构建 docker 镜像。我在 Spring Boot 应用程序中使用了 Spotify docker 插件。

这是我的 pom.xml 的插件部分

    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>com.spotify</groupId>
            <artifactId>dockerfile-maven-plugin</artifactId>
            <version>1.4.13</version>
            <configuration>
                <repository>${docker.image.prefix}/${docker.image.name}</repository>
                <tag>${project.version}</tag>
            </configuration>
        </plugin>
    </plugins>

运行 mvn dockerfile:build 时出现以下错误:

    Could not build image: entry 'pom.xml' closed at '4150' before the '6047' bytes specified in the header were written -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

0 个答案:

没有答案