Home  >  Article  >  Operation and Maintenance  >  How to package docker image?

How to package docker image?

烟雨青岚
烟雨青岚Original
2020-06-17 10:18:104930browse

How to package docker image?

How to package docker image?

Method steps:

1. First reference the maven docker plug-in

How to package docker image?

2. Open java Apply the jar package, as shown in the figure below, click the package button

How to package docker image?

3. Create a new docker folder and put the exported jar package into this folder

How to package docker image?

4. Create a new Dockerfile file and enter the packaging command as shown below

FROM frolvlad/alpine-oraclejdk8:slimVOLUME /tmpADD agpt-admin-0.0.1-SNAPSHOT. jar app.jarRUN sh -c 'touch /app.jar'ENV LANG C.UTF-8ENV JAVA_OPTS=""ENTRYPOINT [ "sh", "-c",

"java -Djava.security.egd =file:/dev/./urandom -jar /app.jar $JAVA_OPTS" ]

How to package docker image?

5. Click the docker plug-in build command button

How to package docker image?

6. The package is successfully packaged to the server, and the log information shown in the figure below is output.

How to package docker image?

7. Check the docker image directory of the server and find the docker just exported. Mirror

How to package docker image?

Recommended tutorial: docker tutorial

The above is the detailed content of How to package 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