Dockerfile Package Springboot small items, and export

Source: Internet
Author: User
Tags docker run

1. The base image of this image is: https://www.cnblogs.com/JoeyWong/p/9173265.html

2. Put the packaged project files in a directory similar to Dockerfile

3, Dockerfile as follows:

# Base OS image fromCentos:jdk8MaintainerJoey <your email>LABELDescription= "This image is Javaweb images." Version= "1.0"#java WebRUNmkdir/home/data# uploading project files locally to the mirrorADDjavaweb-package.zip/home/data# unzip the project and delete the extra files after decompressionRUNunzip/home/data/javaweb-package.zip-d/home/data/&& rm-rf/home/data/javaweb-package.zip #授权RUNChmod-r +x/home/data/javaweb-1.0#开放8080端口EXPOSE8080#在启动后执行web项目的启动脚本entrypoint["Sh", "/home/data/javaweb-1.0/start.sh"]

4. Note:

1, the project decompression path, at the beginning I did not extract the project to the specified path, and then the resulting image in the project was extracted to the/directory, so that the project is always running error

2. When I run the project startup script after the last boot, I use nohup in my script, running in the background, so the container will exit after Docker run!! So I added the tail-f $PRG _dir/log.log the command to view the log dynamically at the end of my start.sh script, and this is done!

5, create the image, note. It's important .

Docker build-t Javaweb:1.0 .

6. Export the image, where

Docker Save < Mirror id>>/root/javaweb-docker. Tar

Dockerfile Package Springboot small items, and export

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.