edit-icon download-icon

Create images based on EDAS basic image

Last Updated: Jun 26, 2018

Constraints and suggestions

  • To ensure that you can use all functions of EDAS, do NOT modify Tomcat default boot scripts, directories or the path of logs.
  • If a new version EDAS application is published, you need to re-package and publish the image to obtain new functions and features of EDAS. If the last packed image has been published for a long time, it is recommended that you update the basic image and re-package and publish it. For details, see Download an EDAS basic image.
  • Directory list
    • Tomcat directory: /home/admin/taobao-tomcat-production-7.0.59.3/
    • Log directory: /root/logs/
    • WAR package directory: /home/admin/taobao-tomcat-production-7.0.59.3/deploy/

Create a custom basic image

Use any of the following methods to create a custom basic image:

Method 1: Compile a Dockerfile

After pulling the expected basic image, compile a Dockerfile to prepare a standard image. The following examples describe how to publish a WAR package and modify Tomcat configurations.

Note: Do not use the CMD command to create the boot script for the custom image.

Example 1: Add the local application /tmp/edas-app.war to the image and publish the application in image mode.

  1. FROM registry.aliyuncs.com/edas/edas-container:3.2
  2. ADD /tmp/edas-app.war /home/admin/taobao-tomcat-production-7.0.59.3/deploy/

Example 2: Replace server.xml and install the system monitoring tool SAR.

  1. FROM registry.aliyuncs.com/edas/edas-container:3.2
  2. ADD /tmp/server.xml /home/admin/taobao-tomcat-production-7.0.59.3/conf/server.xml
  3. RUN yum install -y sysstat

After compiling Dockerfile, publish the image.

Method 2: Use the local Docker command

Similar to the file copy command cp, run the following command to copy the local file /tmp/app.war to the WAR package directory in the packaging environment.

Format:

docker cp Local file path edas-build-package:container file path
docker cp /tmp/app.war edas-build-package:/home/admin/taobao-tomcat-production-7.0.59.3/deploy/

Take the preceding command as an example, run the following command to copy the local file /tmp/app.war to the WAR package deployment directory of the container:

docker cp /tmp/app.war edas-build-package:/home/admin/taobao-tomcat-production-7.0.59.3/deploy/

Method 3: Download the remote file in the Docker container

  1. Run docker exec -it edas-build-package bash to go to the container.

  2. Run wget http://anything-you-want/local storage path to download the file.

Deploy a WAR package

Thank you! We've received your feedback.