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
demandé il y a un an480 vues
1 réponse
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/

répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions