Search code examples
amazon-web-servicesdockerdocker-composeamazon-ecs

How to check if EFS is mounted on a docker container?


I have created a task definition and mounted EFS but i'm not sure if it works..

So i wanted to verify if my EFS file system is mounted to the running container ?

How can i verify ?


Solution

  • One way is to add a file to the folder inside your container:

    1. ssh into the underlying ECS EC2 instance with ssh -i "somekey.pem" [email protected]
    2. Run docker ps to get the id of your container.
    3. docker exec -it CONTAINERID /bin/bash to move inside the container. Inside the container create or copy a file to the EFS-folder.

    Now go to the EFS console and verify that the Metered size is greater than 0 meaning your file is in EFS.


    enter image description here