# FROM openjdk:8 # FROM openjdk:8-jdk-alpine FROM maven:3.8.4-openjdk-11-slim AS builder LABEL email="liuyuqi" WORKDIR /app # COPY pom.xml . # COPY src ./src # RUN mvn clean package -DskipTests VOLUME [ "/app" ] CMD ["/bin/sh", "-c", "while true; do sleep 1000; done"] # FROM openjdk:11-jre-slim as runner # WORKDIR /app # ARG JAVA_OPTS # ENV JAVA_OPTS=$JAVA_OPTS # COPY --from=builder ./target/*.jar app.jar # EXPOSE 8080 # VOLUME [ "/app" ] # ENTRYPOINT ["exec", "java","$JAVA_OPTS" , "-jar", "app.jar"]