简体   繁体   中英

How to mount a FUSE-based filesystem on docker container running on AWS?

I need to mount a FUSE-based filesystem (using rclone ) on a docker container that must be executed on AWS ECS Fargate.

I have no problem running the container locally using the following command:

docker run --rm --device /dev/fuse --cap-add SYS_ADMIN <IMAGE_NAME>

While on AWS ECS Fargate the docker container is not working properly because I haven't found how to set the flags --device and --cap-add when I define the task on AWS ECS. Any suggestion would be really appreciated.

Unfortunately I wasn't able to find a direct solution to the problem. This is the workaround that I used back then:

I switched to an ECS task of EC2 type because, how you can see in the official documentation , both the flag --device and --cap-add were and still are not available for tasks launched on Fargate.

In this way, only through the JSON definition of the task, I was able to add the flags that I needed. Here below a sample json definition that shows how to add these properties:

{
  ... 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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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