diff --git a/backend/Dockerfile b/backend/Dockerfile index 40e635565a..b6c2953df3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,24 +1,34 @@ ### Builder FROM ghcr.io/graalvm/native-image:ol8-java17-22.3.3 AS build +# Install Maven +RUN microdnf update --nodocs -y && \ + microdnf install -y wget tar && \ + wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \ + tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt && \ + ln -s /opt/apache-maven-3.8.6 /opt/maven && \ + ln -s /opt/maven/bin/mvn /usr/bin/mvn && \ + rm apache-maven-3.8.6-bin.tar.gz && \ + microdnf clean all + +# Add Maven to the PATH environment variable +ENV MAVEN_HOME /opt/maven +ENV PATH $MAVEN_HOME/bin:$PATH + # Receiving app version ARG APP_VERSION=0.0.1 # Copy WORKDIR /app COPY pom.xml ./ -COPY mvnw ./mvnw COPY src ./src -COPY .mvn/ ./.mvn - -RUN chmod +x mvnw # Setting app version -RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ - ./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true +RUN mvn versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ + mvn versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true # Build -RUN ./mvnw -Pnative native:compile +RUN mvn -Pnative native:compile ### Deployer diff --git a/legacy/Dockerfile b/legacy/Dockerfile index 910e79dd78..59f7be0713 100644 --- a/legacy/Dockerfile +++ b/legacy/Dockerfile @@ -1,24 +1,34 @@ ### Builder FROM ghcr.io/graalvm/native-image:ol8-java17-22.3.3 AS build +# Install Maven +RUN microdnf update --nodocs -y && \ + microdnf install -y wget tar && \ + wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \ + tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt && \ + ln -s /opt/apache-maven-3.8.6 /opt/maven && \ + ln -s /opt/maven/bin/mvn /usr/bin/mvn && \ + rm apache-maven-3.8.6-bin.tar.gz && \ + microdnf clean all + +# Add Maven to the PATH environment variable +ENV MAVEN_HOME /opt/maven +ENV PATH $MAVEN_HOME/bin:$PATH + # Receiving app version ARG APP_VERSION=0.0.1 # Copy WORKDIR /app COPY pom.xml ./ -COPY mvnw ./mvnw COPY src ./src -COPY .mvn/ ./.mvn - -RUN chmod +x mvnw # Setting app version -RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ - ./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true +RUN mvn versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ + mvn versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true # Build -RUN ./mvnw -Pnative native:compile +RUN mvn -Pnative native:compile ### Deployer diff --git a/processor/Dockerfile b/processor/Dockerfile index 3ba6435b7b..b7adcc8307 100644 --- a/processor/Dockerfile +++ b/processor/Dockerfile @@ -1,24 +1,34 @@ ### Builder FROM eclipse-temurin:17.0.8.1_1-jdk-jammy AS build +# Install Maven +RUN apt update -y && \ + apt install -y wget tar && \ + wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \ + tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt && \ + ln -s /opt/apache-maven-3.8.6 /opt/maven && \ + ln -s /opt/maven/bin/mvn /usr/bin/mvn && \ + rm apache-maven-3.8.6-bin.tar.gz && \ + apt-get clean + +# Add Maven to the PATH environment variable +ENV MAVEN_HOME /opt/maven +ENV PATH $MAVEN_HOME/bin:$PATH + # Receiving app version ARG APP_VERSION=0.0.1 # Copy WORKDIR /app COPY pom.xml ./ -COPY mvnw ./mvnw COPY src ./src -COPY .mvn/ ./.mvn - -RUN chmod +x mvnw # Setting app version -RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ - ./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true +RUN mvn versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \ + mvn versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true # Build -RUN ./mvnw clean package -DskipTests -Dtests.skip=true -Dskip.unit.tests=true +RUN mvn clean package -DskipTests -Dtests.skip=true -Dskip.unit.tests=true ### Deployer FROM eclipse-temurin:17.0.8.1_1-jre-jammy AS deploy