Search code examples
dockeramazon-ecsvolumeaws-fargate

How do I set the docker volume in ecs?


I'm going to transfer what I worked on the previous EC2 to the ECS.

In traditional EC2, the -v /home/ubuntu:/data option allowed the volume to be set.

First, I added volume through "Volume add in task definition" and proceeded with mounting as before.

However, this did not produce a normal result.

So I have some concerns.

For Ubuntu, it's the /home/ubuntu path, but I'm not sure how the ECS Fargate path is configured.

Secondly, I am wondering if adding :/data at the end of the container path is the right way.

Defined Volume

Volume set to existing EC2 written in JSON

Mount Points in ECS


Solution

  • With Fargate you would need to use an EFS volume for this. You don't have access to host volumes with Fargate.