gcsfuse在读取或写入docker中的已安装目录时给出输入/输出错误

Mar*_*all 5 fuse docker gcsfuse

我在docker容器中使用gcsfuse(基本映像centos7),并且无法读取或写入已安装的目录.

我正在使用gcsfuse安装目录,如下所示:

[root@6c24c3a6cc28 /]# gcsfuse --foreground --key-file=/src/gcloud_service_account.json my-bucket /gcloud/
Using mount point: /gcloud
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
Run Code Online (Sandbox Code Playgroud)

当我尝试读取或写入已安装的目录时,我收到此错误:
[root @ 6c24c3a6cc28 /] #ls -la/gcloud/ls:reading directory/gcloud /:输入/输出错误总数0

gcsfuse打印出调试信息说:

fuse:2016/01/14 01:33:41.110260*fuseops.ReadDirOp错误:readAllEntries:ReadEntries:ListObjects:获取https://www.googleapis.com/storage/v1/b/my-bucket/o?delimiter =%2F&projection = full:私钥应该是PEM或普通PKSC1或PKCS8; 解析错误:asn1:结构错误:标记不匹配(16 vs {class:1 tag:27 length:123 isCompound:true}){optional:false explicit:false application:false defaultValue:tag:stringType:0 timeType: 0 set:false omitEmpty:false} pkcs1PrivateKey @ 2

我正在运行这样的
docker :docker run -p 3000:3000 \
 --privileged\--cap-add SYS_ADMIN\--device/dev/fuse\--name gcsfuseTest\gcsfuseImage

我不是100%肯定--cap-add SYS_ADMIN和--device/dev/fuse得到我.我把它们放在其他使用docker上的保险丝安装的用户的基础上.

Mar*_*all 13

我可以通过在运行gcsfuse时打开一些调试标志来解决这个问题,如下所示:

gcsfuse --foreground --debug_gcs --debug_http --debug_fuse --debug_invariants --key-file=/src/gcloud_service_account.json dev-my-bucket /gcloud

这返回了很多信息,以及:

"code":403,"message":"未配置访问权限.您的项目未启用API(云存储JSON API).请使用Google Developers Console更新您的配置."

我在Google Devlopers Console中启用了这个API,然后在几分钟之后,vuala就可以了.