Dockerfile-petclinic-base 880 B

1234567891011121314151617181920
  1. FROM eclipse-temurin:11 as app-build
  2. # This is the base image that will contain a built version of the spring-petclinic-rest
  3. # application. Installing the dependencies and maven compiling the application is time
  4. # consuming, so we do it in a base image to save time nightly.
  5. RUN apt update && apt install -y git
  6. WORKDIR /app
  7. RUN git clone http://github.com/spring-petclinic/spring-petclinic-rest.git
  8. WORKDIR /app/spring-petclinic-rest
  9. # We have to pin the version because upstream petclinic has breaking api changes after this commit
  10. RUN git checkout 8aa4d49
  11. RUN ./mvnw package -Dmaven.test.skip=true
  12. RUN cp target/spring-petclinic-rest*.jar /app/spring-petclinic-rest.jar
  13. FROM bellsoft/liberica-openjdk-alpine:21.0.3
  14. COPY --from=app-build /app/spring-petclinic-rest.jar /app/spring-petclinic-rest.jar
  15. WORKDIR /app
  16. EXPOSE 9966
  17. CMD ["java", "-jar", "spring-petclinic-rest.jar"]