I wrote a Hello World Spring Boot app. It's a Maven project.
Now I want to dockerize this app. It is important that the .jar is created by Docker.
Dockerfile:
FROM maven:3.5-jdk-8 AS build
WORKDIR /app
COPY src .
COPY pom.xml .
RUN mvn -f pom.xml clean package
FROM openjdk:8-alpine
COPY --from=build /src/app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","app.jar"]
The creation keeps failing. What am I doing wrong in the Dockerfile? I got the basic idea of the Dockerfile from this post. How to dockerize maven project? and how many ways to accomplish it?