From 80974031b691523e8b2aba68af6fe626aa4f62b3 Mon Sep 17 00:00:00 2001 From: bizmate Date: Wed, 10 Feb 2021 09:00:29 +0000 Subject: [PATCH] Adding usage of CIFS mounts so it is clear how to connect to a Samba share also by using hostnames. --- storage/volumes.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/storage/volumes.md b/storage/volumes.md index 9519d8b174..a90cbc7b1d 100644 --- a/storage/volumes.md +++ b/storage/volumes.md @@ -500,6 +500,19 @@ docker service create -d \ nginx:latest ``` +### Create CIFS/Samba volumes + +You can mount a Samba share directly in docker without configuring a mount point on your host. +```bash +docker volume create \ + --driver local \ + --opt type=cifs \ + --opt device=//uxxxxx.your-server.de/backup \ + --opt o=addr=uxxxxx.your-server.de,username=uxxxxxxx,password=*****,file_mode=0777,dir_mode=0777 \ + --name cif-volume +``` +Notice the `addr` option is required if using a hostname instead of an IP so docker can perform the hostname lookup. + ## Backup, restore, or migrate data volumes Volumes are useful for backups, restores, and migrations. Use the