Home >Operation and Maintenance >Docker >How to make a jar package into a docker image
How to make a jar package into a docker image?
1. Write the Dockerfile file
FROM java:8 ADD SPRINGCLOUD.jar app.jar RUN bash -c ‘touch /app.jar’ ENTRYPOINT ["-java","-jar","/app.jar"]
java:8 Existing java version number
SPRINGCLOUD.jar jar package name
2. Place the jar package and the Dockerfile in the same file
3. Execute sudo docker build -t="center" .
4. Center is the name used to generate the image. Remember **.* *
Don’t miss it. Center is the name used to generate the image. Remember. Don’t miss it.
If the picture above appears, it means the image has been generated successfully
The above is the detailed content of How to make a jar package into a docker image. For more information, please follow other related articles on the PHP Chinese website!