Home >Operation and Maintenance >Docker >How to package docker image?
How to package docker image?
Method steps:
1. First reference the maven docker plug-in
2. Open java Apply the jar package, as shown in the figure below, click the package button
3. Create a new docker folder and put the exported jar package into this folder
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" ]
5. Click the docker plug-in build command button
6. The package is successfully packaged to the server, and the log information shown in the figure below is output.
7. Check the docker image directory of the server and find the docker just exported. Mirror
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!