FUSE inside Docker

前端 未结 3 1333
南旧
南旧 2021-01-31 04:54

I\'m trying to install and use FUSE inside a Docker container. My Dockerfile is the following:

FROM golang:1.8

WORKDIR /go/src/app
COPY . .

RUN apt-get update          


        
3条回答
  •  醉梦人生
    2021-01-31 05:07

    With respect to Nickolay's answer below, the --privileged flag is not strictly required, for fuse. And you're best to avoid giving that much privilege to your container.

    You should be able to get things working by replacing it with --cap-add SYS_ADMIN like below.

    docker run -d --rm \
               --device /dev/fuse \
               --cap-add SYS_ADMIN \
          
    

    Sometimes this may not work. In this case, you should try and tweak the AppArmor profile or just disable it as follows:

    docker run -d --rm \
               --device /dev/fuse \
               --cap-add SYS_ADMIN \
               --security-opt apparmor:unconfined \
          
    

    Finally, if all fails, use --privileged flag.

提交回复
热议问题