edit-icon download-icon

Deploy images

Last Updated: Mar 12, 2018

Basic image environment list

The following basic services are built in the EDAS Docker container to meet the baseline requirements for running EDAS applications.

  • CentOS 7
  • JDK 7 (default) or JDK 8 (optional)
  • Ali-Tomcat 7

Perform the following steps to deploy an image:

  1. Create a container image repository
  2. Log on to the remote repository
  3. Update/Create a basic image container
  4. Package the local image
  5. Upload the local image to the image repository

Create a container image repository

  1. Log on to the Docker Image Repository Console, and click Image List in the left-side navigation pane.

  2. On the Image Repository List page, click Create Image Repository in the upper right corner.

  3. Based on the project features, configure Repository Name, Repository Type and other required parameters, and set Code Source to Local Repository.

  4. Click Create Image Repository.

    Note: If the code is confidential, set Repository Type to Private.

    The preceding configuration is used for the following examples. To modify the configuration, see Paths and command reference.

Log on to the remote repository

  1. Log on to the Image Repository console. On the Image List page, click Modify Docker Logon Password to set the logon password.

  2. Click Manage for the image repository you just created.

  3. Find the code for logging on to Alibaba Cloud Docker Registry provided on the page, copy the code to the terminal, and enter the password.

    1. > docker login --username=**********@aliyun.com registry.cn-hangzhou.aliyuncs.com
    2. < Password:
    3. < Login Succeeded

    If “Login Succeeded” is displayed, the login succeeds.

Update/Create a basic image container

To re-package the basic image, initialize the entire packaging environment again and clear data. Back up data before performing the preceding operations.

  1. (Skip this step if it is creation for the first time.) Back up the code and change file.

  2. (Skip this step if if it is creation for the first time.) See Download an EDAS basic image to update the local basic image.

    1. docker pull registry.aliyuncs.com/edas/edas-container:3.0.0
  3. Run the following commands to initialize the packaging environment and clear existing data. (Replace the image version number with your actual version number.)

    1. docker rm -f -v edas-build-package
    2. docker run --name edas-build-package -d --restart=always registry.aliyuncs.com/edas/edas-container:3.0.0

Package the local image

After creating a custom basic image, based on different packaging methods, execute the following shell command to package the image. The packaged image is stored locally.

Note: Replace the last image address with the image repository name created in creating a container image repository, and enter a version number that is easy to identify.

The following command is used as an example. Package the service registry.cn-hangzhou.aliyuncs.com/edas/demo-frontend-service with the version number 20161111.

  1. For Method 1: Compile a Dockerfile

    1. docker build -t demo-frontend-service:20161111 -f /tmp/Dockerfile .
    2. docker tag demo-frontend-service:20161111 registry.cn-hangzhou.aliyuncs.com/edas/demo-frontend-service:20161111
  2. For Method 2: Use the local Docker command or Method 3: Download the remote file in the Docker container

    1. export IMAGE_ID=`docker ps -a -f name=edas-build-package --format {{.ID}}` && docker commit $IMAGE_ID registry.cn-hangzhou.aliyuncs.com/edas/demo-frontend-service:20161111

Upload the local image to the image repository

Run the following command to push the local image to the remote server for deployment. If a message is displayed indicating that you have not logged on or do not have the permission, refer to Log on to the remote repository.

The following command is used as an example to show how to push the local image to the remote service repository registry.cn-hangzhou.aliyuncs.com/edas/demo-frontend-service with the version number 20161111.

  1. docker push registry.cn-hangzhou.aliyuncs.com/edas/demo-frontend-service:20161111
Thank you! We've received your feedback.