In my current scenario I add network drives to a machine with the package gvfs (gio mount smb:/IP/public). Currently, these are only samba shares, but should remain open. After a successful mount the data on the network drive is available via the path /run/user//gvfs/smb-share:server=IP,share=public/.
I want to add such a directory to a container using bind mount. Concerning the special characters in the gvfs link I found the post (https://github.com/docker/cli/issues/1480) which concerns exactly my problem. However, it seems that this is no longer possible and I have no success adding such a link to a container. The following error message is displayed:
docker: Error response from daemon: invalid mount config for type "bind": stat /run/user/<id>/gvfs/smb-share:server=<IP>,share=public: permission denied.
As a second solution I tried to add the network drives to the container with docker volumes (example: https://nerdblog.steinkopf.net/2017/12/persistente-docker-volumes-mit-nfs-und-cifs/).
docker volume create --driver local --opt type=cifs --opt device=//<IP>/public --opt o=username=username,password=passwort ShareVolume
This seems to work, but the password is displayed in clear text in a docker volume inspect. Is there any way to prevent this from being displayed?
Thanks for any help,
here are some version information about the os and docker
$ hostnamectl Static hostname: bwlp-client-test Icon name: computer-desktop Chassis: desktop Machine ID: c73680c569f1477c8b9f9e9bf3c60b39 Boot ID: 91a1f36714664244baf3985f7e4994e1 Operating System: Ubuntu 18.04.4 LTS Kernel: Linux 4.19.142-openslx+ Architecture: x86-64 Client: Docker Engine - Community Version: 19.03.12 API version: 1.40 Go version: go1.13.10 Git commit: 48a66213fe Built: Mon Jun 22 15:45:36 2020 OS/Arch: linux/amd64 Experimental: false
$ docker version Server: Docker Engine - Community Engine: Version: 19.03.12 API version: 1.40 (minimum version 1.12) Go version: go1.13.10 Git commit: 48a66213fe Built: Mon Jun 22 15:44:07 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683