不幸的是,我无法找到问题的直接解决方案。这是我当时使用的解决方法:
我切换到 EC2 类型的 ECS 任务是因为,您可以在官方文档中看到,标志--device和--cap-add曾经并且仍然不可用于在 Fargate 上启动的任务。
这样,只有通过任务的 JSON 定义,我才能添加我需要的标志。下面是一个示例 json 定义,显示了如何添加这些属性:
{
... other properties
"containerDefinitions": [
... other properties
"linuxParameters": {
"capabilities": {
"add": [
"SYS_ADMIN"
],
"drop": null
},
... other properties
"devices": [
{
"containerPath": "/dev/fuse",
"hostPath": "/dev/fuse",
"permissions": null
}
],
... other properties
},
... other properties
],
... other properties
}