gpt4 book ai didi

docker - 安装 davfs2 卷时无法在 docker 容器中打开 fuse 设备

转载 作者:行者123 更新时间:2023-12-02 18:23:45 24 4
gpt4 key购买 nike

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

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

Dockerfile 包含以下内容:

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存在

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

但是挂载失败...我没有在日志中看到有趣的东西:

/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/日志/调试

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

/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

所以一切看起来都很正常。我很乐意得到一些帮助。谢谢。

欧内斯特。

最佳答案

谢谢,添加成功

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

进入 docker run 命令。

关于docker - 安装 davfs2 卷时无法在 docker 容器中打开 fuse 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40106108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com