简体   繁体   English

如何在ecs中设置docker音量?

[英]How do I set the docker volume in ecs?

I'm going to transfer what I worked on the previous EC2 to the ECS.我将把我在以前的 EC2 上的工作转移到 ECS 上。

In traditional EC2, the -v /home/ubuntu:/data option allowed the volume to be set.在传统 EC2 中, -v /home/ubuntu:/data选项允许设置卷。

First, I added volume through "Volume add in task definition" and proceeded with mounting as before.首先,我通过“在任务定义中添加卷”添加卷,并像以前一样继续安装。

However, this did not produce a normal result.然而,这并没有产生正常的结果。

So I have some concerns.所以我有些担心。

For Ubuntu, it's the /home/ubuntu path, but I'm not sure how the ECS Fargate path is configured.对于 Ubuntu,它是/home/ubuntu路径,但我不确定 ECS Fargate 路径是如何配置的。

Secondly, I am wondering if adding :/data at the end of the container path is the right way.其次,我想知道在容器路径末尾添加:/data是否正确。

Defined Volume定义体积

Volume set to existing EC2 written in JSON卷设置为写入 JSON 的现有 EC2

Mount Points in ECS ECS 挂载点

With Fargate you would need to use an EFS volume for this.使用 Fargate,您需要为此使用EFS 卷 You don't have access to host volumes with Fargate.您无权使用 Fargate 访问主机卷。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM