返回排行榜

ContainX/docker-volume-netshare

Gonetshare.containx.io

Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin

dockervolume-pluginnfsefscifscifs-volume-pluginsambadocker-nfs
Star 增长趋势
Star
1.1k
Forks
165
周增长
Issues
97
5001k
2015年10月2019年5月2022年12月2026年7月
制品库Go Modulesgo get github.com/ContainX/docker-volume-netshare
README

Docker NFS, AWS EFS & Samba/CIFS Volume Plugin

Build Status release

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

Documentation http://netshare.containx.io

Chat/Slack https://containx.slack.com

NFS Prerequisites on Linux

NFS needs to be installed on Linux systems in order to properly mount NFS mounts.

  • For Ubuntu/Debian: sudo apt-get install -y nfs-common
  • For RHEL/CentOS: sudo yum install -y nfs-utils

It is recommend to try mounting an NFS volume to eliminate any configuration issues prior to running the plugin:

sudo mount -t nfs4 1.1.1.1:/mountpoint /target/mount

Installation

From Source

$ go get github.com/ContainX/docker-volume-netshare
$ go build

From Binaries

Binaries are available through GitHub releases. You can download the appropriate binary, package and version from the Releases page

On Ubuntu / Debian

The method below will install the sysvinit and /etc/default options that can be overwritten during service start.

  1. Install the Package
  $ wget https://github.com/ContainX/docker-volume-netshare/releases/download/v0.36/docker-volume-netshare_0.36_amd64.deb
  $ sudo dpkg -i docker-volume-netshare_0.36_amd64.deb
  1. Modify the startup options in /etc/default/docker-volume-netshare
  2. Start the service service docker-volume-netshare start

Usage

Launching in NFS mode

1. Run the plugin - can be added to systemd or run in the background

  $ sudo docker-volume-netshare nfs

2. Run the plugin - adding the correct DOCKER_API_VERSION If you are not using the latest stable version of docker engine please specify the version with flag. For example: To check docker API version:

docker version
Client:
Version:	17.12.0-ce
API version:	1.35
Go version:	go1.9.2
Git commit:	c97c6d6
Built:	Wed Dec 27 20:11:19 2017
OS/Arch:	linux/amd64

Server:
Engine:
 Version:	17.12.0-ce
 API version:	1.35 (minimum version 1.12)
 Go version:	go1.9.2
 Git commit:	c97c6d6
 Built:	Wed Dec 27 20:09:53 2017
 OS/Arch:	linux/amd64
 Experimental:	false

Here the Docker API Version is 1.35. So you should start the plugin with the right version of Docker API.

Minimum supported version for the plugin is 1.12.

  $ sudo docker-volume-netshare nfs -a 1.35

2. Launch a container

  $ docker run -i -t --volume-driver=nfs -v nfshost/path:/mount ubuntu /bin/bash

Launching in EFS mode

1. Run the plugin - can be added to systemd or run in the background

  // With File System ID resolution to AZ / Region URI
  $ sudo docker-volume-netshare efs
  // For VPCs without AWS DNS - using IP for Mount
  $ sudo docker-volume-netshare efs --noresolve

2. Launch a container

  // Launching a container using the EFS File System ID
  $ docker run -i -t --volume-driver=efs -v fs-2324532:/mount ubuntu /bin/bash
  // Launching a container using the IP Address of the EFS mount point (--noresolve flag in plugin)
  $ docker run -i -t --volume-driver=efs -v 10.2.3.1:/mount ubuntu /bin/bash

Launching in Samba/CIFS mode

Docker Version < 1.9.0

1. Run the plugin - can be added to systemd or run in the background

  $ sudo docker-volume-netshare cifs --username user --password pass --domain domain --security security -a docker_api_version

2. Launch a container

  // In CIFS the "//" is omitted and handled by netshare
  $ docker run -it --volume-driver=cifs -v cifshost/share:/mount ubuntu /bin/bash
.NetRC support

.NetRC is fully support eliminating users and passwords to be specified in step 1. To use .netrc do the following steps:

1. Create a /root/.netrc file (since netshare needs to be run as a root user). Add the host and credential mappings.

See example:

  //.netrc
  machine some_hostname
       username  jeremy
       password  somepass
       domain    optional
       security  optional
       fileMode  optional
       dirMode   optional

2. Run the plugin

  $ sudo docker-volume-netshare cifs -a docker_api_version

3. Launch a container

  // In CIFS the "//" is omitted and handled by netshare
  $ docker run -it --volume-driver=cifs -v cifshost/share:/mount ubuntu /bin/bash

Docker Version 1.9.0+

Docker 1.9.0 now has support for volume management. This allows you to user docker volume create to define a volume by name so options and other info can be eliminated when running a container.

1. Run the plugin - can be added to systemd or run in the background

  $ sudo docker-volume-netshare cifs -a docker_api_version

2. Create a Volume

This will create a new volume via the Docker daemon which will call Create in netshare passing in the corresponding user, pass and domain info.

  $ 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

3. Launch a container

  // cifs/share matches the volume as defined in Step #2 using docker volume create
  $ docker run -it -v cifshost/share:/mount ubuntu /bin/bash

Security Option

Some 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. e.g.: Apple Time Capsule's require the security mode ntlm.

License

This software is licensed under the Apache 2 license, quoted below.

Copyright 2019 ContainX / Jeremy Unruh

Licensed 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

http://www.apache.org/licenses/LICENSE-2.0 Unless 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.

相关仓库
louislam/uptime-kuma

A fancy self-hosted monitoring tool

JavaScriptnpmMIT Licenseuptimemonitoring
uptime.kuma.pet
89.4k8.1k
Stirling-Tools/Stirling-PDF

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

JavaMavenOtherdockerjava
stirling.com
87.7k7.8k
macrozheng/mall

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于Spring Boot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

JavaMavenApache License 2.0spring-bootspring-security
macrozheng.com/admin/
84.3k29.8k
bregman-arie/devops-exercises

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

PythonPyPIOtherdevopsaws
83.3k19.8k
netdata/netdata

The fastest path to AI-powered full stack observability, even for lean teams.

GoGo ModulesGNU General Public License v3.0monitoringdocker
netdata.cloud
79.8k6.5k
moby/moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

GoGo ModulesApache License 2.0dockercontainers
mobyproject.org
71.9k19k
traefik/traefik

The Cloud Native Application Proxy

GoGo ModulesMIT Licensemicroservicedocker
traefik.io
64.1k6.1k
dani-garcia/vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

Rustcrates.ioGNU Affero General Public License v3.0vaultwardenbitwarden
64k3k
usememos/memos

Open-source, self-hosted note-taking tool built for quick capture. Markdown-native, lightweight, and fully yours.

GoGo ModulesMIT Licensereactgo
usememos.com
61.7k4.6k
sansan0/TrendRadar

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

PythonPyPIGNU General Public License v3.0data-analysispython
trendradar.sandev.cc
60.8k24.8k
coollabsio/coolify

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.

PHPPackagistApache License 2.0nodejsmysql
coolify.io
59.2k5.1k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k