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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则