安装davfs2卷时无法打开docker容器中的保险丝设备 [英] can't open fuse device in a docker container when mounting a davfs2 volume

查看:246
本文介绍了安装davfs2卷时无法打开docker容器中的保险丝设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在docker容器上安装davfs2卷时遇到以下错误:

I encounter the following error when I try to mount a davfs2 volume on a docker container :

geoserver@8e8091d97157:~$ mount owncloud/
/sbin/mount.davfs: loading kernel module fuse
/sbin/mount.davfs: loading kernel module fuse failed
/sbin/mount.davfs: waiting for /dev/fuse to be created
/sbin/mount.davfs: can't open fuse device
/sbin/mount.davfs: trying coda kernel file system
/sbin/mount.davfs: no free coda device to mount

的免费coda设备Dockerfile具有以下内容:

The Dockerfile has the following content :

FROM debian:jessie

ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux

# environment variables
ENV GEOSERVER_PASS  geoserver

RUN apt-get update
RUN apt-get install -y davfs2 fuse

RUN groupadd --gid 999 geoserver
RUN useradd -ms /bin/bash --home /home/geoserver \
        -p $(echo "print crypt("${GEOSERVER_PASS:-geoserver}", "salt")" | perl) \
        --uid 999 --gid 999 geoserver

USER geoserver
RUN mkdir /home/geoserver/owncloud
RUN mkdir /home/geoserver/.davfs2

USER root
ADD secrets /home/geoserver/.davfs2/secrets
RUN chown geoserver:geoserver /home/geoserver/.davfs2/secrets
RUN chmod 0600 /home/geoserver/.davfs2/secrets

RUN chmod u+s /sbin/mount.davfs
RUN perl -p -i -e "s/#\s*use_locks\s*1/use_locks 0/" /etc/davfs2/davfs2.conf
RUN adduser geoserver davfs2
RUN echo "https://my-owncloud-server.org/owncloud/remote.php/webdav /home/geoserver/owncloud davfs rw,user,noauto 0 0" >> /etc/fstab

设备/ dev / fuse存在

The device /dev/fuse exists

root@8e8091d97157:/# ls -l /dev/fuse
crw-rw-rw- 1 root root 10, 229 Oct 18 12:06 /dev/fuse

但是安装失败...
i在日志中看不到有趣的东西:

But the mount fails... i do not see interesting things in the logs :

/var/log/daemon.log

/var/log/daemon.log

root@8e8091d97157:/# tail /var/log/daemon.log 
Oct 18 12:36:03 8e8091d97157 mount.davfs: davfs2 1.5.2
Oct 18 12:36:04 8e8091d97157 mount.davfs: the server certificate is not trusted
Oct 18 12:36:04 8e8091d97157 mount.davfs:   issuer: TERENA, Amsterdam, Noord-Holland, NL
Oct 18 12:36:04 8e8091d97157 mount.davfs:   subject: Domain Control Validated
Oct 18 12:36:04 8e8091d97157 mount.davfs:   identity: owncloud-mshe.univ-fcomte.fr
Oct 18 12:36:04 8e8091d97157 mount.davfs:   accepted by user

/ var / log / debug

/var/log/debug

root@8e8091d97157:/# tail /var/log/debug 
Oct 18 12:36:03 8e8091d97157 mount.davfs: davfs2 1.5.2

/var/log/auth.log

/var/log/auth.log

root@8e8091d97157:/# tail /var/log/auth.log 
Oct 18 12:35:59 8e8091d97157 su[890]: Successful su for geoserver by root
Oct 18 12:35:59 8e8091d97157 su[890]: + ??? root:geoserver
Oct 18 12:35:59 8e8091d97157 su[890]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory
Oct 18 12:35:59 8e8091d97157 su[890]: pam_unix(su:session): session opened for user geoserver by (uid=0)
Oct 18 12:36:09 8e8091d97157 su[890]: pam_unix(su:session): session closed for user geoserver

的会话已关闭,因此一切似乎都很正常。
我很乐意得到一些帮助。
谢谢。

So everything seems to be normal. I would be happy to get some help. Thanks.

Ernest。

推荐答案

谢谢,通过添加

--privileged --cap-add=SYS_ADMIN --device /dev/fuse

进入docker run命令。

in to docker run command.

这篇关于安装davfs2卷时无法打开docker容器中的保险丝设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆