I am working on mounting a DAVFS
volume inside docker
container.
Many documents suggest to use privileged run
command... But I am trying to build the docker
image with it.
I am getting error:
no free coda device available.
Any ideas what I am doing wrong? I am using AWS EKS
to deploy this image. If there is an option to do this with EKS
, that answer is also acceptable.
DockerFile :
RUN apt-get update && apt-get install -y fuse davfs2 ca-certificates
RUN mkdir /mnt/ftp/
ARG WEB_DAV_URL=DAVFS_URL
RUN echo "DAVFS_URL DAVFS_USERNAME DAVFS_PASSWORD" >> /etc/davfs2/secrets
RUN mount.davfs $WEB_DAV_URL /mnt/
CMD service php7.2-fpm restart && cd /etc/apache2/ && apachectl -d /etc/apache2 -e info -DFOREGROUND
Error log :
mount.davfs: loading kernel module fuse
mount.davfs: loading kernel module fuse failed
mount.davfs: waiting for /dev/fuse to be created
mount.davfs: can't open fuse device
mount.davfs: trying coda kernel file system
mount.davfs: no free coda device to mount
Note : I need something for docker build, not for docker run... As I am using EKS, docker run is not applicable... :-) There is way to do this via Docker run to add CAP_ADD.
you can use PersistentVolume in your pod while launching it. you need to check for volume plugin which support DAVFS. and to add Capabilities to your pod you can use securityContext module in your pods. refer to below link:
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/