Issue
Trying to docker my web app with gradle. But gradle dosnt create a lib directory with Jar
I checked my folders by RUN ls -al /home/gradle/src/build/
but folder is empty
My docker file is:
FROM gradle:7.1.1-jdk11 AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle addCredentials --key nexusLogin --value "62" && \
gradle addCredentials --key nexusPassword --value "!" && \
gradle build --no-daemon
RUN ls -al /home/gradle/src/build/
FROM openjdk:11.0.11-9-slim
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/app-0.0.1-SNAPSHOT-plain.jar /app/target-discovery.jar
ENTRYPOINT ["java", "-jar", "/app/target-discovery.jar"]
Solution
Gradle by default builds the jar file in
lib/build/libs
not in
src/build
Answered By - Alberto Sinigaglia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.