Sign inSign up

rrapsag/samba

By rrapsag

Updated over 1 year ago

Simplest samba docker container.

Image
Networking
Databases & storage
0

998

rrapsag/samba repository overview

Samba

A simplest and lightweight samba docker container for sharing files quickly and easily.

Description

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.

Usage

You can get started creating a container from this image either use docker cli or docker-compose.

Docker

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.

Docker Compose

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

Environment variables

The container is configured using environment variables at runtime. We have the following variables available for container configuration:

VariableFunction
USERSpecify username for the share.
PASSSpecify password for the share.
UIDSpecify the user identifier.
GIDSpecify the group identifier.

Tag summary

Content type

Image

Digest

sha256:b4ed4bbe8

Size

23.8 MB

Last updated

over 1 year ago

docker pull rrapsag/samba