Docker build failing when using gcsfuse to mount google storage

那年仲夏 提交于 2019-12-05 06:39:57

If you're running your container on GKE, and you want to use gcsfuse, permissions should automatically be inherited in your account locally. Also...there is a caveat that you need to make sure that the cluster your running needs to have storage access. So make sure your cluster has the storage permissions set to full access. That way gcsfuse can mount your buckets on GCS within the container without having to worry about passing credential files and all that stuff...making the implementation pretty straight forward.

In your docker file...make sure you're doing your apt commands to get and install the gcsfuse application.

I personally made a shell script that I call once the instance is up, that mounts my directories that I needed.

Something like this...

Docker Entry

ENTRYPOINT ["/opt/entry.sh"]

entry.sh script example

gcsfuse [gcs bucket name] [local folder to mount as]

When generating your GKE cluster, make sure to add the storage scope

gcloud container clusters create [your cluster name] --scopes storage-full

Hope this helps you.

your www-data have permission problem in the dockerfile:

#RUN chown www-data:www-data -R /mnt && groupadd fuse && gpasswd -a www-data fuse && chmod g+rw /dev/fuse

uncomment this line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!