How to run a jar file using docker image?
My jar runs on a specific port and I am assuming there is port for the container so how I do run a jar using the docker image? how do these ports communicate with each other? Do I need to expose both of these ports? Do I need both Entrypoint and CMD? My jar file does need to accept any arguments since it can pick the defaults.
One Solution collect form web for “How to run a jar file using docker image?”
If your container does not communicate with the external network (ie. the java program is the only one using those ports) then you do not need to expose the ports. Your entrypoint or cmd can be ~
java -jar /my/jar and it will use your defaults.