volumes ¶
Implementation in the AWS + Docker ECS Plugin ¶
The ECS Plugin which allows you to define, in a similar way to ECS Compose-X, your volumes, is of the opinion that any volume you would create is going to be a shared persistent volume using AWS EFS.
As you can see in these examples , you can either leave things by default or define some EFS equivalent properties to define your volumes.
Implementation in ECS Compose-X ¶
To maintain compatibility with the ECS Plugin, if you did specify that the driver should be nfs or efs (although this is not a supported network driver!), ECS Compose-X will create for you a new FS etc. allowing your containers to connect.
However, by default, ECS Compose-X will follow the behaviour described in the docker-compose volumes reference, which is to respect the driver and driver_opts settings.
Define a volume for the task only ¶
Although you cannot create a tmpfs in AWS Fargate, you might for consistency with your local development, define a volume just to mount to a specific path.
As per the docker-compose volumes reference, we could have the following
services:
service-01:
volumes:
# Just specify a path and let the Engine create a volume
- /var/lib/mysql
There what ECS Compose-X will do is to create in the task definition a new volume using the local driver volume type, and assign that to the container definition in the task definition specifically.