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