Home  >  Article  >  Operation and Maintenance  >  How to make a jar package into a docker image

How to make a jar package into a docker image

WJ
WJOriginal
2020-06-08 17:03:034429browse

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.

How to make a jar package into a docker image

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn