From 626f488a6d5714a1435946a34204f770fdb75266 Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 15:23:10 -0500 Subject: [PATCH] Jenkinsfile_DB2 --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bbf0f70b..792f60f94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ -# Use an official Maven runtime as a parent image -FROM maven:3.8.4-openjdk-17-slim AS build +# Use an official OpenJDK runtime as a parent image +FROM eclipse-temurin:17-jdk-jammy # Set the working directory in the container WORKDIR /app # Copy the compiled JAR file from the build stage -COPY target/*.jar /app/petclinic.jar +#COPY --from=build /home/azureuser/petclinic/target/*.jar /app/petclinic.jar +COPY .mvn/ .mvn/ +COPY mvnw pom.xml ./ +#Run the dependecies on the image +RUN ./mvnw dependency:resolve + +#COPY soruce code from local to the image +COPY src ./src # Specify the command to run on container start -CMD ["java", "-jar", "petclinic.jar"] \ No newline at end of file +CMD ["mvnw", "spring-boot:run"] \ No newline at end of file