java-tutorials/docker/docker-caching/single-module-caching/Dockerfile-Buildkit

13 lines
342 B
Plaintext
Raw Normal View History

2022-02-13 17:56:05 -05:00
FROM maven:alpine as build
ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME
2022-02-13 17:56:05 -05:00
RUN --mount=type=cache,target=/root/.m2 mvn -f $HOME/pom.xml clean package
FROM openjdk:8-jdk-alpine
COPY --from=build /usr/app/target/single-module-caching-1.0-SNAPSHOT-jar-with-dependencies.jar /app/runner.jar
2022-02-13 17:56:05 -05:00
ENTRYPOINT java -jar /app/runner.jar