Overview

Last Updated: Apr 01, 2017

The Container Service supports the Docker Compose orchestration template to describe multi-container applications.

The orchestration template allows the description an integrated application that can be composed of several services. For example, a portal application can comprise of a Nginx service, a Web service and a database service.

One service may have several container instances and the configurations of all the container instances have to be consistent. For example, the Web service in the above application can activate two or more containers based on the traffic.

Capacity

The Container Service supports automatic deployment and management of a container application using the orchestration template file.

The labels used by the orchestration template file are compatible with most of the labels described in Docker Compose version 1.5x to 1.7x. For information about specific compatible labels, refer to Label description.

The orchestration template file also supports the version 1 and version 2 Compose file formats. For details, refer to Compose file format versioning.

The Container Service also provides many scale capabilities beyond the community version:

  • Unlike the community versions of Docker Compose and Swarm, Alibaba Cloud Container Service supports cross-node container link, and thus you can directly deploy the application described by Docker Compose to the distributed cluster to provide high availability and scalability.
  • The Container Service, based on the description in the community Compose template, also provides capabilities to simplify the deployment, maintenance and operations of Web and microservice applications. For details, refer to Label description.

Example

The following is a WordPress application. It includes the Web service provided by WordPress image and the db service provided by MySQL image.

  1. web:
  2. image: wordpress:4.2
  3. ports:
  4. - "80"
  5. environment:
  6. - WORDPRESS_AUTH_KEY=changeme
  7. - WORDPRESS_SECURE_AUTH_KEY=changeme
  8. - WORDPRESS_LOGGED_IN_KEY=changeme
  9. - WORDPRESS_NONCE_KEY=changeme
  10. - WORDPRESS_AUTH_SALT=changeme
  11. - WORDPRESS_SECURE_AUTH_SALT=changeme
  12. - WORDPRESS_LOGGED_IN_SALT=changeme
  13. - WORDPRESS_NONCE_SALT=changeme
  14. restart: always
  15. links:
  16. - db:mysql
  17. labels:
  18. aliyun.log_store_wordpress: stdout
  19. aliyun.probe.url: http://container/license.txt
  20. aliyun.probe.initial_delay_seconds: "10"
  21. aliyun.routing.port_80: wordpress;http://www.example.com;https://www.nice.com
  22. aliyun.scale: "3"
  23. db:
  24. image: mysql:5.6
  25. environment:
  26. MYSQL_ROOT_PASSWORD: password
  27. restart: always
  28. labels:
  29. aliyun.log_store_mysql: stdout
Thank you! We've received your feedback.