admin管理员组文章数量:1401589
I understand that when two Docker containers are running on the same Docker host, they can share a named volume by mounting the same volume in both containers. As mentioned in this answer, the named volume is stored on the host machine (e.g., /var/lib/docker/volumes), making it accessible to both containers.
However, in my case, the two containers are running in separate ECS tasks (Fargate or EC2-backed). Each ECS task is effectively running on a separate Docker host, as defined in this answer:
The docker host is the base traditional OS server where the OS and processes are running in normal (non-container) mode. So the OS and processes you start by actually powering on and booting a server (or VM) are the docker host. The processes that start within containers via docker commands are your containers.
Given that each ECS task has its own Docker host, a local named volume is no longer a viable option for sharing data between these two tasks.
Question: What are the recommended ways to share persistent storage between two containers running in separate ECS tasks? I’m aware that Amazon EFS is commonly used, but are there cases where S3, FSx, or other solutions might be preferable?
The two tasks may be running on different EC2 instances or different AWS-managed infrastructure (Fargate). The storage needs to support read/write access across both tasks.
本文标签:
版权声明:本文标题:amazon web services - How to share a volume between two containers running in separate ECS tasks (on different Docker hosts)? - 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744316026a2600267.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论