For example:-
Environment:- A nginx docker container running on ecs cluster Now I have file by the name my.cnf in the docker container
Location:- /home/bakul/my.cnf
What I want?
Basically, I am interested in copying this file i.e(/home/bakul/my.cnf) into the host machine (ecs instance).
Problem:- When I tried to define the task definition then I use
Volume:- /home/ec2-user/test/my.cnf (Host machine path)
For container, I used the mount point as:- /home/bakul/my.cnf
When I run the task definitions, instead of mounting the file, it creates the directory in the host machine.
References Used:-
https://docs.docker.com/storage/#good-use-cases-for-bind-mounts https://docs.aws.amazon.com/AmazonECS/latest/developerguide/example_task_definitions.html