diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f894015 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,128 @@ +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Maven template +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# Eclipse m2e generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +### JEnv template +# JEnv local Java version configuration file +.java-version + +# Used by previous versions of JEnv +.jenv-version + +### Eclipse template +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### JDeveloper template +# default application storage directory used by the IDE Performance Cache feature +.data/ + +# used for ADF styles caching +temp/ + +# default output directories +classes/ +deploy/ +javadoc/ + +# lock file, a part of Oracle Credential Store Framework +cwallet.sso.lck diff --git a/Dockerfile b/Dockerfile index 5524d35..0e15ece 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,22 @@ -FROM eclipse-temurin:11-jdk-focal +FROM maven:3.9.9-eclipse-temurin-11-focal AS builder + +ENV MAVEN_OPTS="-Dmaven.repo.local=/opt/maven" +ENV M2_HOME="/opt/maven/m2" + +WORKDIR /project +COPY . /project + +RUN --mount=type=cache,target=/opt/maven/m2 mvn clean package -DskipTests + +FROM eclipse-temurin:11-jdk-focal AS runtime LABEL authors="jens" # Set working directory WORKDIR /app -# Copy jar with dependencies -COPY target/CorrelationDetective-1.0-jar-with-dependencies.jar /app/cd.jar +# Copy fat jar +COPY --from=builder /project/target/CorrelationDetective-1.0-jar-with-dependencies.jar /app/cd.jar -# Create a directory to store input data -RUN mkdir /app/data # Set the entrypoint to running the jar file ENTRYPOINT ["java", "-cp", "cd.jar", "core/Main"]