diff --git a/Dockerfile b/Dockerfile index 792f60f94..daf0a48ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,15 @@ FROM eclipse-temurin:17-jdk-jammy WORKDIR /app # Copy the compiled JAR file from the build stage -#COPY --from=build /home/azureuser/petclinic/target/*.jar /app/petclinic.jar -COPY .mvn/ .mvn/ -COPY mvnw pom.xml ./ +COPY /target/*.jar /app/petclinic.jar +#COPY .mvn/ .mvn/ +#COPY mvnw pom.xml ./ #Run the dependecies on the image -RUN ./mvnw dependency:resolve +#RUN ./mvnw dependency:resolve #COPY soruce code from local to the image -COPY src ./src +#COPY src ./src # Specify the command to run on container start -CMD ["mvnw", "spring-boot:run"] \ No newline at end of file +#CMD ["mvnw", "spring-boot:run"] +CMD ["java","-jar","/app/petclinic.jar"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index f174eb468..bc6ebe043 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,9 +22,8 @@ pipeline { stage ('Build a Docker Image') { steps { // Build a Docker image - script { - def customImage = docker.build('petclinic:auto') - } + sh 'docker build -t petclinic:auto .' + } } stage ('Archive test results') {