{"id":13416309,"url":"https://github.com/ContainX/docker-volume-netshare","last_synced_at":"2025-03-14T23:31:36.646Z","repository":{"id":43917788,"uuid":"44638257","full_name":"ContainX/docker-volume-netshare","owner":"ContainX","description":"Docker NFS, AWS EFS, Ceph \u0026 Samba/CIFS Volume Plugin","archived":false,"fork":false,"pushed_at":"2021-04-12T10:34:49.000Z","size":3186,"stargazers_count":1115,"open_issues_count":100,"forks_count":164,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-10-29T17:56:36.190Z","etag":null,"topics":["cifs","cifs-volume-plugin","docker","docker-nfs","efs","nfs","samba","volume-plugin"],"latest_commit_sha":null,"homepage":"http://netshare.containx.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-20T22:21:35.000Z","updated_at":"2024-10-17T09:04:08.000Z","dependencies_parsed_at":"2022-09-26T17:01:10.730Z","dependency_job_id":null,"html_url":"https://github.com/ContainX/docker-volume-netshare","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainX%2Fdocker-volume-netshare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainX%2Fdocker-volume-netshare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainX%2Fdocker-volume-netshare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainX%2Fdocker-volume-netshare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainX","download_url":"https://codeload.github.com/ContainX/docker-volume-netshare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242995910,"owners_count":20218828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cifs","cifs-volume-plugin","docker","docker-nfs","efs","nfs","samba","volume-plugin"],"created_at":"2024-07-30T21:00:56.886Z","updated_at":"2025-03-14T23:31:32.669Z","avatar_url":"https://github.com/ContainX.png","language":"Go","readme":"# Docker NFS, AWS EFS \u0026 Samba/CIFS Volume Plugin\n\n[![Build Status](https://travis-ci.org/ContainX/docker-volume-netshare.svg)](https://travis-ci.org/ContainX/docker-volume-netshare) [![release](http://github-release-version.herokuapp.com/github/ContainX/docker-volume-netshare/release.svg?style=flat)](https://github.com/ContainX/docker-volume-netshare/releases/latest)\n\nMount NFS v3/4, AWS EFS or CIFS inside your docker containers.  This is a docker plugin which enables these volume types to be directly mounted within a container.\n\n### Documentation [http://netshare.containx.io](http://netshare.containx.io)\n### Chat/Slack [https://containx.slack.com](https://containx.slack.com)\n\n## NFS Prerequisites on Linux\n\nNFS needs to be installed on Linux systems in order to properly mount NFS mounts.  \n\n- For Ubuntu/Debian: `sudo apt-get install -y nfs-common`\n- For RHEL/CentOS: `sudo yum install -y nfs-utils`\n\nIt is recommend to try mounting an NFS volume to eliminate any configuration issues prior to running the plugin:\n```\nsudo mount -t nfs4 1.1.1.1:/mountpoint /target/mount\n```\n\n## Installation\n\n#### From Source\n\n```\n$ go get github.com/ContainX/docker-volume-netshare\n$ go build\n```\n\n#### From Binaries\n\nBinaries are available through GitHub releases.  You can download the appropriate binary, package and version from the [Releases](https://github.com/ContainX/docker-volume-netshare/releases) page\n\n#### On Ubuntu / Debian\n\nThe method below will install the sysvinit and /etc/default options that can be overwritten during service start.\n\n1. Install the Package\n\n```\n  $ wget https://github.com/ContainX/docker-volume-netshare/releases/download/v0.36/docker-volume-netshare_0.36_amd64.deb\n  $ sudo dpkg -i docker-volume-netshare_0.36_amd64.deb\n```\n\n2. Modify the startup options in `/etc/default/docker-volume-netshare`\n3. Start the service `service docker-volume-netshare start`\n\n\n## Usage\n\n### Launching in NFS mode\n\n**1. Run the plugin - can be added to systemd or run in the background**\n\n```\n  $ sudo docker-volume-netshare nfs\n```\n**2. Run the plugin - adding the correct DOCKER_API_VERSION**\nIf you are not using the latest stable version of docker engine please specify the version with flag.\nFor example:\nTo check docker API version:\n```\ndocker version\nClient:\nVersion:\t17.12.0-ce\nAPI version:\t1.35\nGo version:\tgo1.9.2\nGit commit:\tc97c6d6\nBuilt:\tWed Dec 27 20:11:19 2017\nOS/Arch:\tlinux/amd64\n\nServer:\nEngine:\n Version:\t17.12.0-ce\n API version:\t1.35 (minimum version 1.12)\n Go version:\tgo1.9.2\n Git commit:\tc97c6d6\n Built:\tWed Dec 27 20:09:53 2017\n OS/Arch:\tlinux/amd64\n Experimental:\tfalse\n```\nHere the Docker API Version is 1.35. So you should start the plugin with the right version of Docker API.\n\nMinimum supported version for the plugin is 1.12.\n\n```\n  $ sudo docker-volume-netshare nfs -a 1.35\n```\n\n\n**2. Launch a container**\n\n```\n  $ docker run -i -t --volume-driver=nfs -v nfshost/path:/mount ubuntu /bin/bash\n```\n\n### Launching in EFS mode\n\n**1. Run the plugin - can be added to systemd or run in the background**\n\n```\n  // With File System ID resolution to AZ / Region URI\n  $ sudo docker-volume-netshare efs\n  // For VPCs without AWS DNS - using IP for Mount\n  $ sudo docker-volume-netshare efs --noresolve\n```\n\n**2. Launch a container**\n\n```\n  // Launching a container using the EFS File System ID\n  $ docker run -i -t --volume-driver=efs -v fs-2324532:/mount ubuntu /bin/bash\n  // Launching a container using the IP Address of the EFS mount point (--noresolve flag in plugin)\n  $ docker run -i -t --volume-driver=efs -v 10.2.3.1:/mount ubuntu /bin/bash\n```\n\n### Launching in Samba/CIFS mode\n\n#### Docker Version \u003c 1.9.0\n\n**1. Run the plugin - can be added to systemd or run in the background**\n\n```\n  $ sudo docker-volume-netshare cifs --username user --password pass --domain domain --security security -a docker_api_version\n```\n\n**2. Launch a container**\n\n```\n  // In CIFS the \"//\" is omitted and handled by netshare\n  $ docker run -it --volume-driver=cifs -v cifshost/share:/mount ubuntu /bin/bash\n```\n\n##### .NetRC support\n\n.NetRC is fully support eliminating users and passwords to be specified in step 1.  To use .netrc do the following steps:\n\n**1. Create a /root/.netrc file (since netshare needs to be run as a root user).  Add the host and credential mappings.**  \n\nSee example:\n\n```\n  //.netrc\n  machine some_hostname\n       username  jeremy\n       password  somepass\n       domain    optional\n       security  optional\n       fileMode  optional\n       dirMode   optional\n```\n\n**2. Run the plugin**\n\n```\n  $ sudo docker-volume-netshare cifs -a docker_api_version\n```\n\n**3. Launch a container**\n\n```\n  // In CIFS the \"//\" is omitted and handled by netshare\n  $ docker run -it --volume-driver=cifs -v cifshost/share:/mount ubuntu /bin/bash\n```\n\n#### Docker Version 1.9.0+\n\nDocker 1.9.0 now has support for volume management.  This allows you to user `docker volume create` to define a volume by name so\noptions and other info can be eliminated when running a container.\n\n**1. Run the plugin - can be added to systemd or run in the background**\n\n```\n  $ sudo docker-volume-netshare cifs -a docker_api_version\n```\n\n**2. Create a Volume**\n\nThis will create a new volume via the Docker daemon which will call `Create` in netshare passing in the corresponding user, pass and domain info.\n\n```\n  $ docker volume create -d cifs --name cifshost/share --opt username=user --opt password=pass --opt domain=domain --opt security=security --opt fileMode=0777 --opt dirMode=0777\n```\n\n**3. Launch a container**\n\n```\n  // cifs/share matches the volume as defined in Step #2 using docker volume create\n  $ docker run -it -v cifshost/share:/mount ubuntu /bin/bash\n```\n\n#### Security Option\nSome CIFS servers may require a specific security mode to connect. The ``security`` option defines the ``sec`` option that is passed to ``mount.cifs``. [More information about available ``sec`` options](https://www.samba.org/~ab/output/htmldocs/manpages-3/mount.cifs.8.html).\ne.g.: Apple Time Capsule's require the security mode ``ntlm``.\n\n## License\n\nThis software is licensed under the Apache 2 license, quoted below.\n\nCopyright 2019 ContainX / Jeremy Unruh\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","funding_links":[],"categories":["Container Operations","Go","docker"],"sub_categories":["Volume Management / Data"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FContainX%2Fdocker-volume-netshare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FContainX%2Fdocker-volume-netshare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FContainX%2Fdocker-volume-netshare/lists"}