techragesh
techragesh

Reputation: 381

Cannot find 'dockerFileDir' in class io.fabric8.maven.docker.config.ImageConfiguration

I am building docker through fabric8 maven plugin. I am getting the below error when build mvn clean package docker:build

Unable to parse configuration of mojo io.fabric8:docker-maven-plugin:0.21.0:build for parameter dockerFileDir: Cannot find 'dockerFileDir' in class io.fabric8.maven.docker.config.ImageConfiguration -> [Help 1]

Plugin configuration

<plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <version>0.21.0</version>
            <configuration>
                <dockerHost>unix:///var/run/docker.sock</dockerHost>
                <verbose>true</verbose>
                <images>
                    <image>
                        <name>${docker.image.prefix}/${docker.image.name}</name>
                        <dockerFileDir>{project.basedir}/src/main/docker/</dockerFileDir>
                        <!--copies artifact to docker build dir in target-->
                        <assembly>
                            <descriptorRef>artifact</descriptorRef>
                        </assembly>
                        <tags>
                            <tag>latest</tag>
                            <tag>${project.version}</tag>
                        </tags>
                    </image>
                </images>
            </configuration>
        </plugin>

Anyone help me about this issue

Thanks in Advance

Upvotes: 2

Views: 1674

Answers (1)

Luke
Luke

Reputation: 1306

dockerFileDir as well as tags should be within build tag:

<image>
    <name>${docker.image.prefix}/${docker.image.name}</name>
    <build>
        <dockerFileDir>{project.basedir}/src/main/docker/</dockerFileDir>
        <tags>
            <tag>latest</tag>
            <tag>${project.version}</tag>
        </tags>
    </build>
   ....
</image>

Upvotes: 2

Related Questions