It could be possible that someone wants to access files stored on a Windows Network Share
(aka. smb
/ Samba Share
/ CIFS
) using a linux system.
You need to either run the image in privileged mode or add capabilities: docker run --cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH...
-
Make sure cifs-support is available on the system:
# Ubuntu / Debian / etc. apt install cifs-utils # CentOS / Fedora / RHEL / etc. yum install samba-client samba-common cifs-utils
-
Mount the drive
# Unprotected share: mount -t cifs <drive> <mountpoint> # e.g.: mount -t cifs //172.16.1.100/folder$ /mnt
# Protected share: PASSWD=<pass> mount -t cifs -o username=<user> <drive> <mountpoint> # e.g.: PASSWD=pass mount -t cifs -o username=user //172.16.1.100/folder$ /mnt # The password needs to be provided using an command line variable. Since .. export PASSWD=pass # .. raises security concerns since the password is now available to the entire linux system, the password is provided using a command local variable.