chore: Added a Docker-Build
authorKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:48:34 +0000 (19:48 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:48:34 +0000 (19:48 +0100)
.dockerignore [new file with mode: 0644]
.maven-dockerexclude [new file with mode: 0644]
.maven-dockerinclude [new file with mode: 0644]
Dockerfile [new file with mode: 0644]
pom.xml

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..1ad9963
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!target/*.jar
diff --git a/.maven-dockerexclude b/.maven-dockerexclude
new file mode 100644 (file)
index 0000000..72e8ffc
--- /dev/null
@@ -0,0 +1 @@
+*
diff --git a/.maven-dockerinclude b/.maven-dockerinclude
new file mode 100644 (file)
index 0000000..fd6cecd
--- /dev/null
@@ -0,0 +1 @@
+target/*.jar
diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..503f939
--- /dev/null
@@ -0,0 +1,5 @@
+FROM eclipse-temurin:17-jre
+VOLUME /tmp
+COPY target/*.jar /opt/app.jar
+ENTRYPOINT [ "java", "-jar", "/opt/app.jar" ]
+CMD []
diff --git a/pom.xml b/pom.xml
index b5b0e81..2819be4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <plugin>
         <artifactId>maven-failsafe-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>io.fabric8</groupId>
+        <artifactId>docker-maven-plugin</artifactId>
+        <version>0.33.0</version>
+        <configuration>
+          <images>
+            <image>
+              <name>juplo/%a:%v</name>
+            </image>
+          </images>
+        </configuration>
+        <executions>
+          <execution>
+             <id>build</id>
+             <phase>package</phase>
+             <goals>
+               <goal>build</goal>
+             </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>