I’m trying to use my host-mounted (via davfs2 utility) WebDAV storage as docker volume, but somehow got Permission denied
though all target and parent folders have 777 linux permissions
# ls -ld /mnt/yandex_webdav
drwxrwxrwx 4 root root 424 Jul 13 09:03 /mnt/yandex_webdav
# docker run -d --name labelstudio -v /mnt/yandex_webdav:/tmp/yandex_webdav heartexlabs/label-studio:latest
# docker exec -it labelstudio ls -la /tmp/yandex_webdav
ls: cannot open directory '/tmp/yandex_webdav': Permission denied
# docker exec -it labelstudio ls -ld /tmp/yandex_webdav
drwxrwxrwx 4 root root 424 Jul 13 09:03 /tmp/yandex_webdav
My host OS is Ubuntu 22.04.3 LTS
, docker version is 26.0.0
What could be wrong?
3
Answers
When you encounter a "permission denied" error or a file is write-protected in the Linux Terminal, you can often resolve it by adding sudo (which stands for "super user do") before the command. This grants the command superuser (administrator) privileges. In your case, the command would be:
sudo docker run -d --name label-studio -v /mnt/yandex_webdav:/tmp/yandex_webdav heartexlabs/label-studio:latest
Perhaps you should try mounting the disk via a driver plugin?
https://github.com/fentas/docker-volume-davfs
rm -rf /mnt/yandex_webdev
podman volume create yandex_webdev
podman run -d -v yandex_webdev:/tmp/yandex_webdev –name webdev docker.io/heartexlabs/label-studio:latest tail -f /dev/null
podman ps -as
podman exec webdev ls -la /tmp