Jenkinsfile_DB2

This commit is contained in:
vishnu1411 2023-12-16 15:23:10 -05:00
parent 4155f5652b
commit 626f488a6d

View file

@ -1,11 +1,18 @@
# Use an official Maven runtime as a parent image # Use an official OpenJDK runtime as a parent image
FROM maven:3.8.4-openjdk-17-slim AS build FROM eclipse-temurin:17-jdk-jammy
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app
# Copy the compiled JAR file from the build stage # 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 # Specify the command to run on container start
CMD ["java", "-jar", "petclinic.jar"] CMD ["mvnw", "spring-boot:run"]