Hello,
I would like to add a CIFS type volume in my container.
I would like to put the share directly in the docker compose and avoid having to create a volume from the command line.
Exemple:
- Volum Name: Data
- Share: //192.168.1.10/Data
- Mountpath: /mnt/Share
- Username: ABCD
- Password: EFGH
- CIFS (version 2.0)
docker volume create
–driver local
–opt type=cifs
–opt device=//192.168.1.10/Data
–opt o=username=ABCD,password=EFGH,vers=2.0
–name Data
meyay
(Metin Y.)
January 8, 2021, 6:11pm
2
Forum search for “volume cifs” and sort by latest brought up this result:
To not bloat the required capabilities unnecessarily, the recommended approach is to use volumes instead (pointing to your CIFS shares) and map them into a folder inside the container, then use them in your containerized app as you would use any local folder.
Either create your volume first and then use it in docker run commands:
docker volume create \
--driver local \
--opt type=cifs \
--opt o=username={smbuser},password={smbpass},uid={UID for mount},gid={gid for mount},vers=3.0 \…
Be aware that declared volumes are immutable once created. If you change settings of a volume, you will need to delete it from the cli, in order to let docker-compose create it with the new configuration.