Code Monkey home page Code Monkey logo

docker-volume-davfs's Introduction

Docker volume plugin for davfs

This plugin allows you to mount remote folder using davfs2 in your container easily.

TravisCI Go Report Card

Usage

1 - Install the plugin

docker plugin install fentas/davfs # or docker plugin install fentas/davfs DEBUG=1

2 - Create a volume

$ docker volume create \
  -d fentas/davfs \
  -o url=<https://user:passwd@host/path> \
  -o uid=1000 -o gid=1000 davvolume
davvolume
$ docker volume ls
DRIVER              VOLUME NAME
local               2d75de358a70ba469ac968ee852efd4234b9118b7722ee26a1c5a90dcaea6751
local               842a765a9bb11e234642c933b3dfc702dee32b73e0cf7305239436a145b89017
local               9d72c664cbd20512d4e3d5bb9b39ed11e4a632c386447461d48ed84731e44034
local               be9632386a2d396d438c9707e261f86fd9f5e72a7319417901d84041c8f14a4d
local               e1496dfe4fa27b39121e4383d1b16a0a7510f0de89f05b336aab3c0deb4dda0e
fentas/davfs        davvolume

NOTE: If you have special characters within your username or/and password you can use -o username=<user> and -o password=<password>. You can check if your url is correctly parsed here: https://play.golang.org/p/JBtsIJjURsK

For more options refer to mount.davfs --help.

3 - Use the volume

$ docker run -it -v davvolume:<path> busybox ls <path>

Global /etc/webdav/webdav.conf atm.

dav_user        root
dav_group       root
kernel_fs       fuse
buf_size        16
connect_timeout 10
read_timeout    30
retry           10
max_retry       300
dir_refresh     30
# file_refresh    10

TODO

  • set custom webdav.conf

THANKS

LICENSE

MIT

docker-volume-davfs's People

Contributors

anthonydahanne avatar ebuildy avatar fentas avatar iiieii avatar sapk avatar tiborvass avatar vieux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-volume-davfs's Issues

Special chars within username

@cocodrino:

sorry @fentas for ask this here, but you don't have an issue area...how could connect to one webdav server where the username has an @ ...like webdav.livedrive.com...my user would be like [email protected] ???

thank you so much

Sorry did not realize that issues were disabled.. Thanks for letting me know. I'll look into it.

Container Boot Faild - logs : VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

docker container boof faild caused by docker-volume-davfs bug, there are the logs:

Failure error while mounting volume Failure error while mounting volume '/var/lib/docker/plugins/66235d61a6c4b16d936c6c2369e343665e65b90fc83cabc9770c3525483c5632/rootfs': VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

I got this problem after I rebooted my vps. To reproduce the bug, I've tried several times on different vps. It reproduced randomly.

To figure out this bug I attached inside of the plugin rootfs sh by "Debugging plugins"

I read the main.go and simulated the action of mount function by shell

mount.davfs http://x.x.x.x:xx/xx /mnt/volumes/223bce26d5145548e9980f5738087c80 -o uid=1000 -o gid=1000

and got those msg:

found PID file /var/run/mount.davfs/mnt-volumes-223bce26d5145548e9980f5738087c80.pid.
Either /mnt/volumes/223bce26d5145548e9980f5738087c80 is used by another process,
or another mount process ended irregular

As so far, the bug is clear. And there're two enhanced features can be discussed:

  1. The different (name) webdav volumes with the same url cannot be support by now due to the same davfs pid name confliction . Could we do some works to support?
  2. The davfs pid file conflicted probabilistically after the physical machines of docker rebooted .

Thanks for your great jobs !

Write error

I configured webdav for pcloud storage and I could access to the folder and explore files but when I try to create file show me this error:

Command:

touch example.txt

Response
touch: cannot touch 'example.txt': I/O error

davfs.sock: connect: no such file or directory

Hi, i'm trying to install your plugin in docker running on openmediavault. Unfortunatelly I get this error. Any ideas what am I doing wrong or what causes the problem?

sudo docker plugin install fentas/davfs
Plugin "fentas/davfs" is requesting the following privileges:
network: [host]
mount: [/var/lib/docker/plugins/]
device: [/dev/fuse]
capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
latest: Pulling from fentas/davfs
60a0c44b5ea4: Download complete
Digest: sha256:623bd2f914267f83eaba03591cbebc4517b2d3bedcc28f70b25c239e6931f356
Status: Downloaded newer image for fentas/davfs:latest
Error response from daemon: dial unix /run/docker/plugins/104207cac63af708387d043260b67c1b785a8d425bae896ac97400d29c1ab50c/davfs.sock: connect: no such file or directory

OK screen, no volume

Following the readme, I get this OK, but no created volumes when I do:
docker volume ls
screen shot 2018-02-23 at 16 48 27

Getting Unknown option

When I try to deploy a stack I get

"create Test_dav-volume: VolumeDriver.Create: unknown option ["url=http://xxxxx:[email protected]:8080/docker/"]"

The Volume entry in Yaml is

volumes:
  dav-volume:
    driver: fentas/davfs
    driver_opts:
      o: url=http://xxxxx:[email protected]:8080/docker/

I may have that wrong as I was unable to locate any documentation on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.