How to set permission on Volume mount #14063
-
In my CDK app I have an ElasticSearch docker that starts on an EC2 instance and on start up it cannot write to the host path's Volume mount point directory which I set to /mnt/data/elasticsearch/ so the container stops, This is how I create the volume and mount point
I cannot find in the API how to either give permission to that container or change the permission on the folder |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The reason is because I was using a bind mounts to mount at container, By default, the volume permissions are set to 0755 and the owner as root. The permissions would need be changed in the Elastic Dockerfile. Instead I used Volume to mount the host dir |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
The reason is because I was using a bind mounts to mount at container, By default, the volume permissions are set to 0755 and the owner as root. The permissions would need be changed in the Elastic Dockerfile. Instead I used Volume to mount the host dir
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html