Overview

Last Updated: Nov 28, 2017

Container Service supports describing multi-container applications by using the Docker Compose orchestration template.

The orchestration template allows you to describe an integrated application. The application can be composed of several services. For example, a portal application is composed of an Nginx service, a Web service, and a database service.

A service might have several containers. Make sure all of the containers have the same configurations. For example, the Web service in the preceding application can start two or more containers based on the traffic.

Capability

Container Service supports automatically deploying and managing an application by using the orchestration template.

The labels used by the orchestration template are compatible with most of the labels in Docker Compose version 1 and version 2. For information about specific compatible labels, see Label description.

The orchestration template also supports the Compose file formats of version 1 and version 2. For details, see Docker Compose version 1 and Docker Compose version 2.

Container Service also provides many extension capabilities based on the community version:

  • Unlike the community version of Docker Compose and Swarm, Alibaba Cloud Container Service supports cross-node container link. So you can directly deploy the application described by Docker Compose template to the distributed cluster to provide high availability and scalability.
  • Container Service, based on the description in the Compose template of community version, also provides extensions to simplify the deployment, operation, and maintenance of Web and microservice applications. For details, see 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.