2016-10-18 65 views
0

我遇到以下錯誤時,當我嘗試安裝在碼頭工人,容器容積davfs2沒有打開熔斷裝置在泊塢窗容器:可以安裝davfs2量

[email protected]:~$ 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 /保險絲存在

[email protected]:/# ls -l /dev/fuse 
crw-rw-rw- 1 root root 10, 229 Oct 18 12:06 /dev/fuse 

但安裝失敗... 我沒有看到有趣的事情在日誌中:

/var/log/daemon.log

[email protected]:/# 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 

/無功/日誌/調試

[email protected]:/# tail /var/log/debug 
Oct 18 12:36:03 8e8091d97157 mount.davfs: davfs2 1.5.2 

/無功/日誌/ AUTH。日誌

[email protected]:/# 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 

所以一切似乎是正常的。 我會很高興得到一些幫助。 謝謝。

歐內斯特。

回答

0

我找到了解決方案。事實上,正如in the DockerCVMFS documentation所述,「」可以在容器中運行FUSE文件系統,但必須在主機系統上啓用FUSE。Docker不會讓您加載無法加載到主機上的內核模塊。

因此,我試圖加載模塊熔斷器在宿主,如在modprobe in a docker container

說明我用下面的命令來啓動容器,和安裝現在是確定:

docker run --name geosync_ssh_data_1 --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules geosync_ssh_data 

的解決方案包括樹步驟:

Run the container in privileged mode (--privileged) 
Add all capabilities (--cap-add=ALL) 
Passthrough /lib/modules into the container (-v /lib/modules:/lib/modules) 

希望它有幫助。

還有一個問題:是唯一的方法嗎?

歐內斯特。

0

這些安全選項太開放。現在記錄的保險絲支持文件爲 Docker runtime privileges。所有你需要的是帶肩加在給搬運工運行命令添加

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

SYS_ADMIN --device的/ dev /保險絲

1

感謝的,成功安裝。

相關問題