Repository: provectus/kafka-ui
Issue: Get rid of dockerfile-maven-plugin
Labels: scope/backend
status/accepted
type/chore

It's deprecated and doesn't work on M1.

Alternatives:
- spring-boot:build-image (via paketo) (preferred)
- jib (not so much)
- fabric8
- maven-exec-plugin (lol)

spring: 
1) add apt packages via [apt buildpack](https://github.com/fagiani/apt-buildpack)

Issue comments:
Builds fine with 
`./mvnw -Dmaven.test.skip=true spring-boot:build-image -Dspring-boot.build-image.imageName=provectuslabs/kafka-ui -Dspring-boot.build-image.builder=paketobuildpacks/builder:tiny`
and jdk17.
The only problem is image size. Need to investigate.
During the research decided to postpone using spring-boot (paketo) due to complicated process of adding plain apk dependencies (we have some in dockerfile).
Fabric8 plugin looks almost identical to the one we currently have, so inclining to that choice.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-api/pom.xml b/kafka-ui-api/pom.xml
index 5c00dc0f6d9..14c2067886c 100644
--- a/kafka-ui-api/pom.xml
+++ b/kafka-ui-api/pom.xml
@@ -443,11 +443,22 @@
                         </executions>
                     </plugin>
                     <plugin>
-                        <groupId>com.spotify</groupId>
-                        <artifactId>dockerfile-maven-plugin</artifactId>
-                        <version>${dockerfile-maven-plugin.version}</version>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <version>${fabric8-maven-plugin.version}</version>
                         <configuration>
-                            <skipPush>true</skipPush>
+                            <verbose>true</verbose>
+                            <images>
+                                <image>
+                                    <name>provectuslabs/kafka-ui:${git.revision}</name>
+                                    <build>
+                                        <contextDir>${project.basedir}</contextDir>
+                                        <args>
+                                            <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
+                                        </args>
+                                    </build>
+                                </image>
+                            </images>
                         </configuration>
                         <executions>
                             <execution>
@@ -456,14 +467,6 @@
                                 <goals>
                                     <goal>build</goal>
                                 </goals>
-                                <configuration>
-                                    <tag>${git.revision}</tag>
-                                    <repository>provectuslabs/kafka-ui</repository>
-                                    <buildArgs>
-                                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
-                                        <JAR_NAME>${project.artifactId}.jar</JAR_NAME>
-                                    </buildArgs>
-                                </configuration>
                             </execution>
                         </executions>
                     </plugin>
diff --git a/pom.xml b/pom.xml
index c06d556132d..513752c85f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
         <kafka-clients.version>3.2.0</kafka-clients.version>
         <node.version>v16.15.0</node.version>
         <pnpm.version>v7.4.0</pnpm.version>
-        <dockerfile-maven-plugin.version>1.4.10</dockerfile-maven-plugin.version>
+        <fabric8-maven-plugin.version>0.40.2</fabric8-maven-plugin.version>
         <frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
         <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
         <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>


Test patch: