在 Google Cloud Container Optimized OS (COS) 中安装 gcsfuse

Install gcsfuse in Google Cloud Container Optimized OS (COS)

有谁知道如何将 gcsfuse 安装到 Google 容器优化 OS 中,以便我可以在 VM 实例本身中安装存储桶。

我尝试 运行 docker 使用 gcsfuse 从主机安装的卷。 docker 容器已成功将存储桶装入主机卷。当我从主机卷上看时,它是空的,但容器有桶数据。

docker run --privileged -v /mnt/disks/bucket:/bucket \
  --device /dev/fuse \
  my_gcsfuse /go/bin/gcsfuse -o allow_other <BUCKET> /bucket
2020/12/16 23:27:21.161246 Initializing GCS connection.
2020/12/16 23:27:21.169616 File system has been successfully mounted.

从容器中,我可以看到所有文件都属于 gcs 存储桶文件,但不属于主机,即使我将卷从主机装载到容器中。

在此 git, the docker-default apparmor profile denies all mounts. This '--security-opt apparmor=unconfined' flag 上解释的问题使挂载 GCS 存储桶成为可能。