Welcome to the Linux Foundation Forum!

Lab 5. Multi-stage Docker Build (Solution) - Not working on Windows

Hello,
I'm referring to document "LFD254Labs09.23.2021.pdf", page 35, Lab 5. Multi-stage Docker Build (Solution)

It didn't work on my Windows laptop. The instructor have already earlier clarified the issue, and provided earlier a solution (spring-javaformat), somehow it was missed in this Dockerfile. It should look like below to work on both Mac & Windows

FROM schoolofdevops/maven:spring AS build
WORKDIR /app
COPY . .
RUN mvn spring-javaformat:apply && \
    mvn package -DskipTests

FROM openjdk:8-alpine AS run
COPY --from=build /app/target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar /run/petclinic.jar
EXPOSE 8080
CMD java -jar /run/petclinic.jar

Categories

Upcoming Training