FROM eclipse-temurin:11.0.26_4-jdk@sha256:0fce1ebca683486d57432c42b8a9764c3fe0b18ae092746248fac258ad05ee00 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.6@sha256:5f23f8082baea518a1657b420dbe19c181483255209b70af836543d6068fed8c 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"]