How to share file or directory with other container on ECS? How to share file or directory with other container on ECS? docker docker

How to share file or directory with other container on ECS?


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