Issue
This is my Dockerfile:
FROM openjdk:17
COPY ./out/production/Company /tmp
WORKDIR /tmp
ENTRYPOINT ["java","Main"]
When I run the Dockerfile I get errors because my project is using a Maven dependency: org.json
I need help editing my Dockerfile to include this Maven dependency
Solution
The easiest way then for you is to use the jib
plugin.
Add the plugin to your project, then create an entrypoint.sh
that tells Docker how to start the app.
Then execute the plugin to build the Docker image. It will figure out all the dependencies and bundle it into the Docker image.
Link: https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin
Answered By - allkenang
Answer Checked By - Katrina (JavaFixing Volunteer)