我正在尝试在docker build
. 我已经阅读了其他线程,here,here,并理解这可能是一个特权问题。它可以通过--privileged
在过程中添加标志来解决docker run
,但我想在构建阶段立即安装桶。
附加到容器上,检查两者fuse
是否gcsfuse
都已安装。GOOGLE_APPLICATION_CREDENTIALS
已设置,访问 Google API 没有问题。这是我得到的错误。
Opening GCS connection...
Opening bucket...
Mounting file system...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: running fusermount: exit status 1
stderr:
fusermount: fuse device not found, try 'modprobe fuse' first
Dockerfile
FROM gcr.io/google-appengine/python
.
.
.
ENV GCSFUSE_REPO=gcsfuse-jessie
RUN apt-get update && apt-get install -y ca-certificates \
&& echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" > /etc/apt/sources.list.d/gcsfuse.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& apt-get update && apt-get install -y gcsfuse
# Config fuse
RUN chmod a+r /etc/fuse.conf
RUN perl -i -pe 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf
# Alter permission
RUN chmod a+w mount-folder
RUN gcsfuse -o --implicit-dirs bucket mount-folder