模板版本的支持
Compose V1/V2 和 Compose V3 版本的编排模板均支持 log 标签,且语法相同。
功能概述
和阿里云日志服务集成,采集容器日志并且发送到阿里云日志服务。更多详细信息,参见
开启日志服务。
[backcolor=transparent]编排示例:
[backcolor=transparent]Compose V1/V2 示例:
- [backcolor=transparent]mysql[backcolor=transparent]:
- [backcolor=transparent] image[backcolor=transparent]:[backcolor=transparent] mysql
- [backcolor=transparent] ports[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] [backcolor=transparent]80
- [backcolor=transparent] labels[backcolor=transparent]:
- [backcolor=transparent] aliyun[backcolor=transparent].[backcolor=transparent]scale[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"1"
- [backcolor=transparent] environment[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] MYSQL_ROOT_PASSWORD[backcolor=transparent]=[backcolor=transparent]password
- [backcolor=transparent]wordpress[backcolor=transparent]:
- [backcolor=transparent] image[backcolor=transparent]:[backcolor=transparent] registry[backcolor=transparent].[backcolor=transparent]aliyuncs[backcolor=transparent].[backcolor=transparent]com[backcolor=transparent]/[backcolor=transparent]jiangjizhong[backcolor=transparent]/[backcolor=transparent]wordpress
- [backcolor=transparent] ports[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] [backcolor=transparent]80
- [backcolor=transparent] labels[backcolor=transparent]:
- [backcolor=transparent] aliyun[backcolor=transparent].[backcolor=transparent]routing[backcolor=transparent].[backcolor=transparent]port_80[backcolor=transparent]:[backcolor=transparent] wordpress[backcolor=transparent]-[backcolor=transparent]with[backcolor=transparent]-[backcolor=transparent]log
- [backcolor=transparent] aliyun[backcolor=transparent].[backcolor=transparent]log_store_dbstdout[backcolor=transparent]:[backcolor=transparent] stdout [backcolor=transparent]#注意这里
- [backcolor=transparent] links[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] mysql
[backcolor=transparent]Compose V3 示例:
- [backcolor=transparent]version[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]'3'
- [backcolor=transparent]services[backcolor=transparent]:
- [backcolor=transparent] web[backcolor=transparent]:
- [backcolor=transparent] image[backcolor=transparent]:[backcolor=transparent] wordpress[backcolor=transparent]:[backcolor=transparent]4
- [backcolor=transparent] ports[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] [backcolor=transparent]80
- [backcolor=transparent] depends_on[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] mysql
- [backcolor=transparent] deploy[backcolor=transparent]:
- [backcolor=transparent] replicas[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]3
- [backcolor=transparent] restart_policy[backcolor=transparent]:
- [backcolor=transparent] condition[backcolor=transparent]:[backcolor=transparent] on[backcolor=transparent]-[backcolor=transparent]failure
- [backcolor=transparent] labels[backcolor=transparent]:
- [backcolor=transparent] aliyun[backcolor=transparent].[backcolor=transparent]routing[backcolor=transparent].[backcolor=transparent]port_80[backcolor=transparent]:[backcolor=transparent] wordpress
- [backcolor=transparent] aliyun[backcolor=transparent].[backcolor=transparent]log_store_dbstdout[backcolor=transparent]:[backcolor=transparent] stdout [backcolor=transparent]#注意这里
- [backcolor=transparent] mysql[backcolor=transparent]:
- [backcolor=transparent] image[backcolor=transparent]:[backcolor=transparent] mysql[backcolor=transparent]:[backcolor=transparent]5.7
- [backcolor=transparent] environment[backcolor=transparent]:
- [backcolor=transparent] [backcolor=transparent]-[backcolor=transparent] MYSQL_ROOT_PASSWORD[backcolor=transparent]=[backcolor=transparent]password
- [backcolor=transparent] deploy[backcolor=transparent]:
- [backcolor=transparent] restart_policy[backcolor=transparent]:
- [backcolor=transparent] condition[backcolor=transparent]:[backcolor=transparent] on[backcolor=transparent]-[backcolor=transparent]failure