2015-08-16 01:52:19 +03:00
|
|
|
[![logo](https://raw.githubusercontent.com/dperson/samba/master/logo.jpg)](https://www.samba.org)
|
2015-01-02 07:03:52 +03:00
|
|
|
|
|
|
|
# Samba
|
|
|
|
|
|
|
|
Samba docker container
|
|
|
|
|
|
|
|
# What is Samba?
|
|
|
|
|
|
|
|
Since 1992, Samba has provided secure, stable and fast file and print services
|
|
|
|
for all clients using the SMB/CIFS protocol, such as all versions of DOS and
|
|
|
|
Windows, OS/2, Linux and many others.
|
|
|
|
|
|
|
|
# How to use this image
|
|
|
|
|
|
|
|
By default there are no shares configured, additional ones can be added.
|
|
|
|
|
|
|
|
## Hosting a Samba instance
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it -p 139:139 -p 445:445 -d dperson/samba
|
2015-01-02 07:03:52 +03:00
|
|
|
|
|
|
|
OR set local storage:
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it --name samba -p 139:139 -p 445:445 \
|
2015-01-02 07:03:52 +03:00
|
|
|
-v /path/to/directory:/mount \
|
|
|
|
-d dperson/samba
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
sudo docker run -it --rm dperson/samba -h
|
|
|
|
Usage: samba.sh [-opt] [command]
|
|
|
|
Options (fields in '[]' are optional, '<>' are required):
|
|
|
|
-h This help
|
2015-06-17 20:37:00 +03:00
|
|
|
-i "<path>" Import smbpassword
|
2016-01-29 03:05:20 +03:00
|
|
|
required arg: "<path>" - full file path in container
|
2016-01-12 13:15:47 +03:00
|
|
|
-s "<name;/path>[;browsable;readonly;guest;users]" Configure a share
|
2015-01-02 07:03:52 +03:00
|
|
|
required arg: "<name>;<comment>;</path>"
|
|
|
|
<name> is how it's called for clients
|
|
|
|
<path> path to share
|
2015-08-02 15:23:04 +03:00
|
|
|
NOTE: for the default values, just leave blank
|
2016-01-12 13:15:47 +03:00
|
|
|
[browsable] default:'yes' or 'no'
|
2015-01-02 07:03:52 +03:00
|
|
|
[readonly] default:'yes' or 'no'
|
|
|
|
[guest] allowed default:'yes' or 'no'
|
|
|
|
[users] allowed default:'all' or list of allowed users
|
2015-12-17 14:17:34 +03:00
|
|
|
[admins] allowed default:'none' or list of admin users
|
2015-01-02 07:03:52 +03:00
|
|
|
-t "" Configure timezone
|
|
|
|
possible arg: "[timezone]" - zoneinfo timezone for container
|
|
|
|
-u "<username;password>" Add a user
|
|
|
|
required arg: "<username>;<passwd>"
|
|
|
|
<username> for user
|
|
|
|
<password> for user
|
|
|
|
|
|
|
|
The 'command' (if provided and valid) will be run instead of samba
|
|
|
|
|
2016-01-05 14:21:05 +03:00
|
|
|
ENVIRONMENT VARIABLES (only available with `docker run`)
|
2015-01-02 07:03:52 +03:00
|
|
|
|
2015-08-16 00:10:17 +03:00
|
|
|
* `TZ` - As above, set a zoneinfo timezone, IE `EST5EDT`
|
2015-01-02 07:03:52 +03:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Any of the commands can be run at creation with `docker run` or later with
|
2016-01-29 03:05:20 +03:00
|
|
|
`docker exec -it samba.sh` (as of version 1.3 of docker).
|
2015-01-02 07:03:52 +03:00
|
|
|
|
2015-08-16 00:10:17 +03:00
|
|
|
### Setting the Timezone
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it -p 139:139 -p 445:445 -d dperson/samba -t EST5EDT
|
2015-01-02 07:03:52 +03:00
|
|
|
|
2015-08-16 00:10:17 +03:00
|
|
|
OR using `environment variables`
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it -e TZ=EST5EDT -p 139:139 -p 445:445 -d dperson/samba
|
2015-08-16 00:10:17 +03:00
|
|
|
|
2015-01-02 07:03:52 +03:00
|
|
|
Will get you the same settings as
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it --name samba -p 139:139 -p 445:445 -d dperson/samba
|
|
|
|
sudo docker exec -it samba samba.sh -t EST5EDT ls -AlF /etc/localtime
|
2015-01-02 07:03:52 +03:00
|
|
|
sudo docker restart samba
|
|
|
|
|
|
|
|
### Start an instance creating users and shares:
|
|
|
|
|
2016-01-29 03:05:20 +03:00
|
|
|
sudo docker run -it -p 139:139 -p 445:445 -d dperson/samba \
|
2015-01-02 07:03:52 +03:00
|
|
|
-u "example1;badpass" \
|
|
|
|
-u "example2;badpass" \
|
|
|
|
-s "public;/share" \
|
|
|
|
-s "users;/srv;no;no;no;example1,example2" \
|
|
|
|
-s "example1 private;/example1;no;no;no;example1" \
|
|
|
|
-s "example2 private;/example2;no;no;no;example2"
|
|
|
|
|
|
|
|
# User Feedback
|
|
|
|
|
|
|
|
## Issues
|
|
|
|
|
|
|
|
If you have any problems with or questions about this image, please contact me
|
|
|
|
through a [GitHub issue](https://github.com/dperson/samba/issues).
|