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
posta un anno fa480 visualizzazioni
1 Risposta
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/

con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande