title: MojoExecutionException: Failed to execute the build: io.fabric8.maven.core.service.Fabric8ServiceException: Error while trying to build the image
body: <p>trying to build and push image using fabric8 but its failiing with following exception -</p>
  <p>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:fabric8-maven-plugin:4.3.1:build (default-cli) on project  :Failed to execute the build: io.fabric8.maven.core.service.Fabric8ServiceException: Error while trying to build the image
  Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to execute the build: io.fabric8.maven.core.service.Fabric8ServiceException: Error while trying to build the image
  [2022-01-20T13:28:34.708Z]     at io.fabric8.maven.plugin.mojo.build.BuildMojo.buildAndTag (BuildMojo.java:299)</p>
  <p>Command I am executing -
  maven:
  commands:
  build_and_push_image:
  enable: true
  goal: &quot;fabric8:build fabric8:push&quot;
  maven_options: &quot;-B -Ddocker.image.release=${SINGLE_CI_BUILD_VERSION} -pl ${SINGLE_CI_MICROSERVICE_NAME}-tests -P ci&quot;</p>
  <p>Pom.xml</p>
  <pre><code>&lt;plugins&gt;
             &lt;plugin&gt;
                  &lt;groupId&gt;io.fabric8&lt;/groupId&gt;
                  &lt;artifactId&gt;fabric8-maven-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;!-- need to disable this to be able to test --&gt;
                      &lt;buildStrategy&gt;docker&lt;/buildStrategy&gt;
                      &lt;mode&gt;kubernetes&lt;/mode&gt;
                      &lt;enricher&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;fmp-project&lt;/exclude&gt;
                          &lt;/excludes&gt;
                      &lt;/enricher&gt;
                      &lt;verbose&gt;true&lt;/verbose&gt;
                      &lt;images&gt;
                          &lt;image&gt;
                              &lt;name&gt;${docker.push.registry}/${docker.image.name}-wiremock:${docker.image.release}&lt;/name&gt;
                              &lt;build&gt;
                                  &lt;from&gt;${base.wiremock.docker.image}&lt;/from&gt;
                                  &lt;labels&gt;
                                      &lt;imageName&gt;${docker.image.name}&lt;/imageName&gt;
                                      &lt;imageVersion&gt;${docker.image.release}&lt;/imageVersion&gt;
                                  &lt;/labels&gt;
                                  &lt;assembly&gt;
                                      &lt;mode&gt;dir&lt;/mode&gt;
                                      &lt;basedir&gt;/home&lt;/basedir&gt;
                                      &lt;inline&gt;
                                          &lt;id&gt;add-wiremock-files&lt;/id&gt;
                                          &lt;fileSets&gt;
                                              &lt;fileSet&gt;
                                                  &lt;directory&gt;${project.build.directory}/wiremock/&lt;/directory&gt;
                                                  &lt;includes&gt;
                                                      &lt;include&gt;**/*&lt;/include&gt;
                                                  &lt;/includes&gt;
                                                  &lt;outputDirectory&gt;wiremock&lt;/outputDirectory&gt;
                                              &lt;/fileSet&gt;
                                          &lt;/fileSets&gt;
                                      &lt;/inline&gt;
                                  &lt;/assembly&gt;
                              &lt;/build&gt;
                          &lt;/image&gt;
                      &lt;/images&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;fmp&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;resource&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  &lt;/plugins&gt;
  </code></pre>