Create a Samba Share and Use from in a Docker Container
Overview This article provides a step-by-step guide on how to create a Samba share from within a Docker container using Ubuntu Server as the host operating system. The tutorial covers two main topics: Installing and configuring Samba on an Ubuntu server Install Samba with sudo apt-get install samba -y Start and enable the Samba service Set a password for users who will access the share Creating a persistent Docker volume mapped to the Samba share: Create a new group and add users to it, setting permissions accordingly Create a persistent Docker volume with docker volume create –opt type=none –opt o=bind –opt device=/data public Deploying an NGINX container using the Docker volume: Mount the Docker volume to the /usr/share/nginx/html directory in the NGINX container Run a new NGINX instance with docker run -d –name nginx-samba -p 8090:80 -v public:/usr/share/nginx/html nginx Testing the setup: Verify that the index.html file is served correctly from the Samba share The article concludes by noting that this setup may not be suitable for production environments, but it can be useful for development or internal services/apps. Key takeaways: Install and configure Samba on an Ubuntu server Create a persistent Docker volume mapped to a shared directory Continue reading


