我正在尝试使用Dockerfile挂载davfs2文件夹(MEGA.nz)。
我的停靠文件:
FROM debian:11
ENV MEGA_USER=megauser@email.com
ENV MEGA_PASS=megapassword
ENV MEGA_FOLDER=megafolder
ENV MEGA_URL=http://127.0.0.1:4443/ABCXYZ
# Install MEGA
RUN apt-get update && apt-get install -y davfs2
RUN apt-get install -y wget
RUN apt install -y apache2
RUN apt install -y apache2-utils
RUN wget https://mega.nz/linux/repo/Debian_11/amd64/megacmd-Debian_11_amd64.deb -P /root/
RUN apt-get install -y /root/megacmd-Debian_11_amd64.deb
RUN mkdir /mnt/mega
RUN mkdir /mnt/mega/files
RUN mega-login ${MEGA_USER} ${MEGA_PASS}
RUN mega-webdav --public /${MEGA_FOLDER}
RUN mount -t davfs ${MEGA_URL}/${MEGA_FOLDER} /mnt/mega/files
RUN apt clean
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]
我可以登录到Mega,但当它尝试挂载时,我收到此错误:
Step 14/19 : RUN mega-login ${MEGA_USER} ${MEGA_PASS}
---> Running in 595c8c09718f
[Initiating MEGAcmd server in background. Log: /root/.megaCmd/megacmdserver.log]
Removing intermediate container 595c8c09718f
---> 9699988d9b0f
Step 15/19 : RUN mega-webdav --public /${MEGA_FOLDER}
---> Running in 0d22f8d0b3d3
[Initiating MEGAcmd server in background. Log: /root/.megaCmd/megacmdserver.log]
Resuming session ...
Serving via webdav /ateka: http://127.0.0.1:4443/KDpDATyD/ateka
Removing intermediate container 0d22f8d0b3d3
---> 62e2d26c621f
Step 16/19 : RUN mount -t davfs ${MEGA_URL}/${MEGA_FOLDER} /mnt/mega/files
---> Running in b7704da9573a
The command '/bin/sh -c mount -t davfs ${MEGA_URL}/${MEGA_FOLDER} /mnt/mega/files' returned a non-zero code: 255
在我的debian发行版中,我可以挂载。但是在我的Dockerfile版本中我不能。我想得到一个使用Dockerfile挂载davfs2的帮助。
编辑:我复制了一个脚本,将其挂载到我的Dockerfile中。
COPY ./up.sh /root
RUN chmod +x /root/up.sh
RUN ./root/up.sh
我尝试运行bash脚本来挂载它,但收到以下消息:
Serving via webdav /ateka: http://127.0.0.1:4443/ABCXYZ/ateka
/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
1条答案
按热度按时间aemubtdh1#
谢谢你的评论。我找到了一个解决保险丝问题的方法。但是我不能运行脚本来安装它。
在docker-compose.yml中
我的mega.sh
但是我