Docker Community Forums

Share and learn in the Docker community.

Maven docker plugin failing to build

My maven clean install is suddenly started to fail when creating docker image. I am getting this :slight_smile:

Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.6:build (default) on project 01-hello-world-rest-api: Execution default of goal com.spotify:dockerfile-maven-plugin:1.4.6:build failed: null value in entry: https://index.docker.io/v1/=null β†’ [Help 1]

This works for me, to build docker image and push to docker hub, I don’t use a docker file, fabric creates it:

mvn clean install fabric8:build fabric8:push

My pom looks like this:

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

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.gregclinker</groupId>
    <artifactId>boot-docker</artifactId>
    <version>1.0.4</version>
    <packaging>jar</packaging>

    <name>Boot Docker</name>
    <description>Spring Boot and Docker</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.1.RELEASE</version>
        <relativePath />
    </parent>


    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

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


    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <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.41</version>
            </plugin>

        </plugins>
    </build>

</project>