Skip to content
/ smb Public

Containerized SMB/CIFS server for testing purposes only

License

Notifications You must be signed in to change notification settings

beezy-dev/smb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMB Container

A lightweight, containerized SMB/CIFS server based on Ubuntu 24.04, designed for testing and development purposes.

Quick Start

You can run this container using either Docker or Podman.

Using Docker Compose

  1. Save the following as compose.yml or use the one provided in the repository:

    services:
      smb:
        image: ghcr.io/beezy-dev/smb:latest
        container_name: smb
        environment:
          NAME: "data"
          USER: "smb"
          PASS: "smb"
          RW: true
          UID: 1000
          GID: 1000
        ports:
          - "445:445"
        volumes:
          - smb:/storage
        restart: always
    
    volumes:
      smb:
        driver: local
  2. Start the service:

    docker compose up -d

Using Podman

You can use podman-compose with the same YAML file above, or run it directly via CLI.

Option 1: Podman Compose

podman-compose up -d

Option 2: Podman CLI

podman run -d \
  --name smb \
  --restart always \
  -p 445:445 \
  -e NAME="data" \
  -e USER="smb" \
  -e PASS="smb" \
  -e RW=true \
  -e UID=1000 \
  -e GID=1000 \
  -v smb:/storage \
  ghcr.io/beezy-dev/smb:latest

Configuration

Environment Variables

Variable Default Description
NAME data Name of the SMB share.
USER smb Username for the SMB user.
PASS smb Password for the SMB user.
UID 1000 User ID for the samba user (matches host permissions).
GID 1000 Group ID for the samba user.
RW true Set to true for read-write access, false for read-only.
DEBUG_LEVEL 1 Samba debug level (0-10).

Volumes

  • /storage: The directory where data is stored and shared.
    • In the examples above, this is mapped to a named volume smb.

Multi-User Support

To create multiple users, map a file to /etc/samba/users.conf with the following format:

username:uid:groupname:gid:password:homedir

Example users.conf:

alice:1001:users:100:password123:/storage/alice
bob:1002:users:100:secret456:/storage/bob

Build Note for Podman Users

If you build the image locally and uncommented the HEALTHCHECK instruction in the Dockerfile, you must use the --format docker flag with Podman:

podman build -t smb-test --format docker .

This is because HEALTHCHECK is a Docker-specific feature not present in the default OCI image format used by Podman.

About

Containerized SMB/CIFS server for testing purposes only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages