docker - 使用 gcsfuse 在 docker 容器中挂载谷歌云存储桶

标签 docker fuse gcsfuse

我正在尝试从 docker 容器中挂载一个谷歌云存储桶并收到以下错误:

[root@cdbdc9ccee5b workdir]# gcsfuse -o allow_other  --debug_gcs --key-file=/src/gcloud_service_account.json my-bucket-name /gcloud
Using mount point: /gcloud
Opening GCS connection...
Opening bucket...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn:     setUpBucket: OpenBucket: Bad credentials for bucket "my-bucket". Check the bucket name and your credentials.

我的凭据适用于我的主机,但不适用于正在运行的容器。 API 说不要使用 root 连接,但您可以使用 -o allow_other 标志( fuse 标志)覆盖它。任何想法表示赞赏。

这是在 centos7 基础镜像上运行的

最佳答案

Root 与 not 在这里是一个红鲱鱼;有问题的凭据是 GCS 凭据。

here有关将 GCS 凭证交给 gcsfuse 的文档。最简单的方法是使用您最初配置 GCE VM 的凭据(假设您在 GCE 上运行),这通常使运行 gcsfuse 无需任何进一步努力即可工作。但如果这不起作用,您可以使用标志 --key-file为 gcsfuse 提供您从 Google Developers Console 下载的 JSON key 文件的路径。

关于docker - 使用 gcsfuse 在 docker 容器中挂载谷歌云存储桶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34758090/

相关文章:

c - 使用 block 特殊文件/设备来实现文件系统

python - 如何用python调用 'read'系统调用

kubernetes - gcsfuse 在 GKE 和/或 python3 boto 中安装存储桶以进行流式写入?

linux - 谷歌云存储桶: Mounting in a Linux instance with Global Permissions

google-cloud-platform - google colab 与 google 云存储数据导出

docker - 尝试在 ubuntu 中以远程用户身份运行 vs 代码开发容器时出现错误

node.js - 使用 docker 和 docker-compose 来运行 npm install 和 Bower install

linux - (FUSE) 文件系统何时检查访问权限?

Windows Server 2019 Docker docker.exe : Error response from daemon: failed to start service utility VM (createreadwrite):

windows - 适用于 Windows Server 2016 的 Docker 需要更新 KB3176936