Coder Social home page Coder Social logo

nfsserver's Introduction

Autopilot Pattern NFS server

This repo Dockerizes sdc-nfs, an NFS v3 server implementation in Node.js. This is intended to allow use NFS in projects without requiring kernel NFS support or privileged access, but that is unfortunately not true.

DockerPulls DockerStars MicroBadger version MicroBadger commit

This is not recommended for production use

Server and client containers need privileged on Linux hosts (though not on Triton, which supports this securely). This may not be a solvable problem. Docker volume drivers are probably the best recommended work around. On Triton, RFD26 will provide network shared filesystems to Docker containers using Docker volume syntax.

For now, consider this an experiment.

Example usage

  1. Get a Joyent account and add your SSH key.
  2. Install the Docker Toolbox (including docker and docker-compose) on your laptop or other environment, as well as the Joyent Triton CLI (triton replaces our old sdc-* CLI tools).
  3. Configure Docker and Docker Compose for use with Joyent.

Check that everything is configured correctly by running ./setup.sh. This will check that your environment is setup correctly and will create an _env file that includes injecting an environment variable for the Consul hostname into the NFSServer container so we can take advantage of Triton Container Name Service (CNS).

Start the NFS server:

docker-compose -p nfsserver up -d

The NFS server will register with the Consul server named in the _env file. You can see its status there in the Consul web UI. On a Mac, you can open your browser to that with the following command:

open "http://$(triton ip nfsserver_consul_1):8500/ui"

Client containers should check Consul for the location of the NFSserver instance to mount. See usage examples in Autopilot Pattern WordPress for more detail.

It is not recommended that users scale the nfsserver service, as the service does not cluster, and each instance is independent from the others. Scaling will lead to partitions.

Testing

Start the service as described above, then...

# put a test file in the NFS server
docker exec -it nfsserver_nfsserver_1 touch "/exports/$(date)"

# start a container as a test client
docker run --rm -it --privileged --link nfsserver_nfsserver_1:nfs ubuntu bash

# get the nfs package for Ubuntu
apt-get update && apt-get install -y nfs-common

# make the directory on which we'll mount the NFS volume
mkdir /nfs

# mount the remote NFS volume
mount -t nfs -v -o nolock,vers=3 nfs:/exports /nfs

# list the contents of the NFS volume
ls -al /nfs

Hacking

This Docker image automates operations using ContainerPilot. See both the Dockerfile and ContainerPilot config for more details of the implementation. A walkthrough of how to build your own applications using the Autopilot Pattern can be found at autopilotpattern.io/example.

Building

This image implements microbadger.com label schema, but those labels require additional build args:

docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
               --build-arg VCS_REF=`git rev-parse --short HEAD` .

nfsserver's People

Contributors

misterbisson avatar

Watchers

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