0% found this document useful (0 votes)
3 views1 page

Java App Dockerfile Setup

This document outlines a Dockerfile for building a Java application using OpenJDK 17. It specifies a multi-stage build process where the application is compiled and packaged before being copied to a final image. The application is then set to run with an entry point and exposes port 8080.

Uploaded by

prajakta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java App Dockerfile Setup

This document outlines a Dockerfile for building a Java application using OpenJDK 17. It specifies a multi-stage build process where the application is compiled and packaged before being copied to a final image. The application is then set to run with an entry point and exposes port 8080.

Uploaded by

prajakta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

FROM openjdk:17-jdk-slim AS build

WORKDIR /app
COPY [Link] ./
COPY src ./src
COPY mvnw ./
COPY .mvn ./.mvn
RUN chmod +x ./mvnw
RUN ./mvnw clean package -DskipTests
FROM openjdk:17-jdk-slim
COPY --from=build /app/target/*.jar [Link]
ENTRYPOINT ["java","-jar","/[Link]"]
EXPOSE 8080

You might also like