Batch: is it possible to bind-mount mounted filesystem from host into container?

0

I am trying to understand whether I can make follwing scenario work with aws batch volumes:

I would like to use an EC2 instance that mounts a file system in fstab into /data. I would like to then use bind-mount to make this file system available in my batch container.

In an interactive session on the ec2 I can do this by using docker run -v /data:/data <container-name>. I could not find this scenario in the bind-mounts section of the docs: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html

All attempts I tried lead to an empty folder being exposed inside the docker container at batch runtime. Is it currently possible to use batch volumes to achieve this or do I need to mount directly inside the container?

Chris
已提問 1 年前檢視次數 480 次
1 個回答
0

It's not completely clear what you want to do. If your EC2 is a ECS node you can do this, it's basicly running the docker commands on your ec2 from the ECS console. But you need to connect it to ecs and run the ecs-agent.

If you want to share volumes between EC2 and containers i would suggest running EFS. This is easily mapped on the ec2's and containers. And it is a persistent storage. https://aws.amazon.com/premiumsupport/knowledge-center/batch-mount-efs/

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南