commit 30dcc9c41acb074aec1e48dcecfb0ccc12be8129 Author: Fernando Schuindt Date: Mon Jul 2 20:07:31 2018 -0300 Start the repository diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..faf93d1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:latest + +RUN apk add --no-cache --update \ + samba-common-tools \ + samba-client \ + samba-server + +COPY smb.conf /etc/samba/smb.conf + +EXPOSE 445/tcp + +CMD ["smbd", "--foreground", "--log-stdout"] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..866488f --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Docker Standalone Samba Server + +Can be used to quick setup a simple Samba container in bridge network mode. It will run as if on host, so it can be accessed from other computers on the same network. + +It also mounts a host directory as the Samba shared point. + +## Warning + +Note the simple `smb.conf` file. + +It will start a **writable Guests allowed server**. + +## Configuration + +Edit the `docker-compose.yml` file, change the `volumes:` section to map the directory you want. + +Eg.: I'm sharing the `/mnt/hdd_repo/Shared/` Docker host directory as the Samba path. You can change it to anything you have on the host: + +```yml +volumes: + - /home/someone/my_folder/:/Shared +``` + +If you want to perform Samba related configurations, just edit the `smb.conf` file to fit your wishes. + +## Running + +Clone the repository: +``` +$ git clone git@github.com:fschuindt/docker-smb.git +``` + +Get into the folder: +``` +$ cd docker-smb +``` + +Build the image: +``` +$ docker-compose build +``` + +Start the container: +``` +$ docker-compose up -d +``` + +## License + +The repository is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8c8ee90 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + samba: + tty: true + network_mode: bridge + volumes: + - /mnt/hdd_repo/Shared/:/Shared + ports: + - "445:445" + build: + context: . + dockerfile: Dockerfile diff --git a/smb.conf b/smb.conf new file mode 100644 index 0000000..01fa87f --- /dev/null +++ b/smb.conf @@ -0,0 +1,9 @@ +[global] + map to guest = Bad User + log file = /var/log/samba/%m + log level = 10 + +[guest] + path = /Shared/ + read only = no + guest ok = yes