Simplest samba docker container.
998
A simplest and lightweight samba docker container for sharing files quickly and easily.
Samba is a service which allows the management and sharing of network resources in a Windows environment, using the SMB/CIFS protocol.
This docker image was created using Alpine Linux and a very simple samba configuration, for quickly creating a shared folder on the network. This allows you to share files between different systems.
The protocol used by samba in this docker image is SMB3. Older Windows versions will not be able to access the folder shared by the container.
When the USER variable is not defined, the shared folder is public, otherwise the shared folder is password protected and can be changed any time when we run the docker command to create the container.
You can get started creating a container from this image either use docker cli or docker-compose.
Start the container with docker run:
docker run -d -p 445:445/tcp --name samba rrapsag/samba
Setting shared folder user and password:
When password is not specified, by default it will be set equal to the USER variable.
docker run -d -p 445:445/tcp \
-e USER=user -e PASS=pass \
--name samba rrapsag/samba
Mapping custom local volume:
docker run -d -p 445:445/tcp \
-e USER=user -e PASS=pass \
-v /tmp/storage:/storage \
--name samba rrapsag/samba
Use user (UID) and group (GID) id to avoid files/folder permissions issues between the host OS and the container when using volumes.
Minimal docker-compose.yml:
services:
samba:
image: rrapsag/samba:latest
container_name: samba
hostname: samba
ports:
- 445:445
environment:
USER: samba
PASSW: samba
#UID: 1000 # optional
#GID: 1000 # optional
volumes:
- /tmp/storage:/storage
restart: unless-stopped
Run:
docker-compose up -d
The container is configured using environment variables at runtime. We have the following variables available for container configuration:
| Variable | Function |
|---|---|
USER | Specify username for the share. |
PASS | Specify password for the share. |
UID | Specify the user identifier. |
GID | Specify the group identifier. |
Content type
Image
Digest
sha256:b4ed4bbe8…
Size
23.8 MB
Last updated
over 1 year ago
docker pull rrapsag/samba