mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:35:50 +00:00
Jenkinsfile_DB2
This commit is contained in:
parent
4155f5652b
commit
626f488a6d
1 changed files with 11 additions and 4 deletions
15
Dockerfile
15
Dockerfile
|
@ -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"]
|
Loading…
Reference in a new issue