I have a Sumologic log collector which is a generic log collector. I want the log collector to see logs and a config file from a different container. How do I accomplish this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
ECS containers can mount volumes so you would define
{
"containerDefinitions": [
{
"mountPoints": [
{
"sourceVolume": "logs",
"containerPath": "/tmp/clogs/"
},
}
],
"volumes": [
{
"name": "logs",
}
]
}
ECS also has a nice UI you can click around to set up the volumes at the task definition level, and then the mounts at the container level.
Once that's set up, ECS will mount a volume at the container path, and everything inside that path will be available to all other containers that mount the volume.
Further reading: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html