How to write a docker file to containerize a Maven- Java hello world app

I have simple pipeline in Jenkins of Java Code of Hello world , I am using maven to build, How to write a docker file to generate docker image from containing artifact

Hi @Nidhi-Thakur,

Here is a sample on how to create a Dockerfile Build your Java image | Docker Docs, but it’s not the only way. Ask yourself the following question:

— Which version of Java I have to use? → the response can be used on base URL
— Do I need to install some dependencies?
— Which file I need for this my application (source code, pom file, application.properties – …)?
— Do I need some environment variable?
— How I run the program (with/ without arguments)?

Regard