[LINUX] Set up a Samba server with Docker

Let's set up a Samba server with Docker.

environment

Build

It seems that dperson / samba is famous, so I will use it.

https://hub.docker.com/r/dperson/samba

If you don't have docker installed, install it the way you like.

sudo snap install docker

Make a container.

sudo docker create -it -p 139:139 -p 445:445 --name smbsrv -v The path you want to share:/path1 dperson/samba \
            -p -r\
            -u "username;password" \
            -s "share;/path1;yes;no;no;username" 

Start the container.

sudo docker start smbsrv

Hopefully you'll see a log like this:

# docker logs smbsrv
Added user username.
smbd version 4.12.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections

The following message is displayed when the option is incorrect. Please rewrite it appropriately and recreate it.

The 'command' (if provided and valid) will be run instead of samba

A brief description of the docker create part

--Write the options of Docker itself before the image name "dperson / samba", and the options of dperson / samba after the image name. --- s option is "Shared folder name; Samba access location in Docker; browseable (display on network computer); readonly (read only); guest (allow guest users); access It means "possible user list (, delimited)". --On Windows, you can access it with "\ server IP address \ share". --- r option disables trash

Access from Windows

All you have to do is add a network location and enter your username and password. image.png image.png

Other

I tried CrystalDiskMark. 1 Gigabit Ethernet. HDD Formatted with ext4. image.png

SSD Formatted with ext4. image.png

reference

https://www.atmarkit.co.jp/ait/articles/0005/22/news008.html

[^ 1]: Requires SATA power supply. I used the USB power cable.

Recommended Posts

Set up a Samba server with Docker
Set up a simple HTTPS server with asyncio
Set up a local server with Go-File upload-
Set up a local server with Go-File download-
Set up a Minecraft resource (Spigot) server via docker (2)
Set up a file server on Ubuntu 20.04 using Samba
Set up a Minecraft resource (Spigot) server via docker
[Vagrant] Set up a simple API server with python
Creating a Flask server with Docker
Set up a web server with CentOS7 + Anaconda + Django + Apache
Set up a mail server using Twisted
Tftp server with Docker
Proxy server with Docker
Set up a simple HTTPS server in Python 3
Start a simple Python web server with Docker
Set up a test SMTP server in Python.
Set up a UDP server in C language
How to set up a local development server
Set up a simple SMTP server in Python
Send mail with mailx to a dummy SMTP server set up with python.
Set up a simple local server on your Mac
Set up Docker on Oracle Linux (7.x) with Vagrant
Set up a free server on AWS in 30 minutes
[Part 1] Let's set up a Minecraft server on Linux
Launch Django on a Docker container with docker-compose up
Set up a Python development environment with Sublime Text 2
Set up a file server using samba on ZeroPi of Friendly Arm [OS installation]
Set up a file server using samba on ZeroPi of Friendly Arm [Purchased Items]
Set up a file server using samba on ZeroPi of Friendly Arm [Personal import]
Set up a Python development environment with Visual Studio Code
Reload the server set up with gunicorn when changing the code
Set up social login with Django
Set up pygit2 with static link
Build a deb file with Docker
Deploy a Django application with Docker
Set up a browser automated test environment that can run Selenium + Pytest with Docker Compose
Steps to set up Pipenv, create a CRUD app with Flask, and containerize it with Docker
Set up Ubuntu as a Linux cheat sheet and https server
Get a local DynamoDB environment with Docker
Let's scrape a dynamic site with Docker
Draw a Mandelbrot set with Brainf * ck
Build a Samba server on Arch Linux
[Linux] Build a jenkins environment with Docker
Run a Python web application with Docker
Create a web service with Docker + Flask
[Linux] Build a Docker environment with Amazon Linux 2
Set up a Lambda function and let it work with S3 events!
Build a CentOS Linux 8 environment with Docker and start Apache HTTP Server
Set up reverse proxy to https server with CentOS Linux 8 + Apache mod_ssl
Set up a local web server in 30 seconds using python 3's http.server
Set up a server that processes multiple connections at the same time
Introduction and usage of Python bottle ・ Try to set up a simple web server with login function
Build a local server with a single command [Mac]
Install Windows 10 from a Linux server with PXE
Set up golang with goenv on GNU / Linux
[Python] Build a Django development environment with Docker
Pretend to be a server with two PCs
Launch a web server with Python and Flask
Set up a Python development environment on Marvericks
Mount a directory on another server with sshfs
Create a "Hello World" (HTTP) server with Tornado