I am trying to mount a davfs2 folder (MEGA.nz) using Dockerfile.
My Dockerfile:
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"]
I can login into Mega but when it try to mount, i receive this error:
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
In my distro debian, i can do the mount. But in my Dockerfile build i cant. I would like a help to mount a davfs2 using Dockerfile.
EDIT: I copy a script to mount it in my Dockerfile.
COPY ./up.sh /root
RUN chmod +x /root/up.sh
RUN ./root/up.sh
I try to run a bash script to mount it, but i receive this:
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