Code Monkey home page Code Monkey logo

docker-volume-nas's Introduction

docker-volume-nas

Simple NAS volume manager: Create volume on shared file system based on folder.

Based on the simple practice to mount a shared volume (i.e. via nfs) and do bind volumes on different repertories in it.

The plugin will look for a mount point and create a new folder in it for each new volume.

Working with nfs share and bind

A common way to persist data for containers is to use bind and nfs/cifs/fuse mount point

  +---------------+ +---------------+
  | docker host   | | docker host   |
  | +-----------+ | | +-----------+ |
  | | container | | | | container | |
  | | /foo      | | | | /foo      | |
  | +----^------+ | | +----^------+ |
  |      | bind   | |      | bind   |
  | /var/nfs/foo  | | /var/nfs/foo  |
  +------^--------+ +------^--------+
         | nfs/cifs mount  |
         +---------+-------+
                   |
      +------------|----+
      | nas server |    |
      | exports /docker |
      +-----------------+

By using a volume plugin the folders can be automaticaly created.

  +---------------+ +---------------+
  | docker host   | | docker host   |
  | +-----------+ | | +-----------+ |
  | | container | | | | container | |
  | | /foo      | | | | /foo      | |
  | +----^------+ | | +----^------+ |
  |      | volume | |      | volume |
  |      |  "foo" | |      |  "foo" |
  | /var/nfs/foo  | | /var/nfs/foo  |
  +------^--------+ +------^--------+
         | nfs/cifs mount  |
         +---------+-------+
                   |
      +------------|----+
      | nas server |    |
      | exports /docker |
      +-----------------+

TODO / Investigation

An evolution of that would be to mount specific folders only when a container needs it. A bit like automapping does. This helps reduce the number of mounts open on an nfs export. Additionally a host not running a container won't have the nfs share mounted. Tell me if intresting, otherwise i will take my time on it.

License

See license

docker-volume-nas's People

Contributors

cblomart avatar

Stargazers

 avatar

Watchers

 avatar  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.