Via Maven I would like to build a Docker image from a Springboot project. I run: mvn clean package docker:build Issue:
ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (default-cli) on project spring-boot-docker: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.21.0:build failed: An API incompatibility was encountered while executing io.
fabric8:docker-maven-plugin:0.21.0:build: java.lang.UnsatisfiedLinkError: unknown
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.fabric8:docker-maven-plugin:0.21.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Johan/.m2/repository/io/fabric8/docker-maven-plugin/0.21.0/docker-maven-plugin-0.21.0.jar
Etc
The maven pom.xml file contains:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<docker.image.prefix>springframeworkguru</docker.image.prefix>
<docker.image.name>springbootdocker</docker.image.name>
<docker.host.url>unix:///var/run/docker.sock</docker.host.url>
</properties>
The build plugin section contains:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.21.0</version>
<configuration>
<dockerHost>${docker.host.url}</dockerHost>
<verbose>true</verbose>
<images>
<image>
<name>${docker.image.prefix}/${docker.image.name}</name>
<build>
<dockerFileDir>${project.basedir}/src/main/docker/</dockerFileDir>
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
<tags>
<tag>latest</tag>
<tag>${project.version}</tag>
</tags>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
As suggested, I removed my maven repository, which did not help. Using other dockerHost values (like http://127.0.0.1:2375) did not help.
I really hope you can help!
This is the solution on Windows 7, 8 and 10 Home: