GithubHelp home page GithubHelp logo

stefi023 / volume-sharer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdiepen/volume-sharer

0.0 1.0 0.0 26 KB

Docker data volume sharer

License: GNU Affero General Public License v3.0

Shell 100.00%

volume-sharer's Introduction

volume-sharer

On my windows 10 laptop from work it is possible to make use of Docker, but due to security restrctions that are in place, I am not able to bind mount a windows folder in a container.

In order to be able to still work easily with data volumes and access the content of them from within my windows environment I updated the dperson/samba container image to not only contain a Docker installation to check all data volumes, but also keep on refreshing the list of shares whenever a data volumes are added/removed.

Usage

Most important is that we need to volume mount the docker volumes directory, as well as the docker socket.

This means that we will need the following:

  • -v /var/lib/docker/volumes:/docker_volumes to bind mount the directory holding all docker volumes
  • -v /var/run/docker.sock:/var/run/docker.sock to bind mount the docker socket, allowing the docker within the container to query information about the volumes

Windows

When running under windows, it will typically already run the SMB shares on the ports 139 and 445 so you cannot use these ports. In order to work around this, you can state that you do not want to bind the ports to the windows host system, but that I want to bind them to the docker image running in Hyper-V.

This is achieved by giving it the same net as the Hyper-V by using the following commandline: docker run --name volume-sharer --rm -v /var/lib/docker/volumes:/docker_volumes -p 139:139 -p 445:445 -v /var/run/docker.sock:/var/run/docker.sock --net=host -d gdiepen/volume-sharer

Linux

If you don't have samba running on your host-system, you can bind the ports. The complete commandline will be:

docker run --name volume-sharer --rm -v /var/lib/docker/volumes:/docker_volumes -p 139:139 -p 445:445 -v /var/run/docker.sock:/var/run/docker.sock -d gdiepen/volume-sharer

##More details I have placed more information on my blog article: https://www.guidodiepen.nl/2017/08/sharing-all-your-docker-data-volumes-via-samba/

volume-sharer's People

Contributors

gdiepen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.