Giter Site home page Giter Site logo

docker-volume-bindfs's Introduction

This project is no longer maintained. Please use the fork from StudioEtrange/docker-volume-bindfs instead.

Docker volume plugin for bindfs

Build Status

This project is based on vieux/docker-volume-sshfs. With this plugin you're able to mount a given path and remap its owner and group.

I recommend using this plugin with dev-environments only, cause of potential security issues.

Usage

1 - Install the plugin

$ docker plugin install lebokus/bindfs

# or to enable debug 
docker plugin install lebokus/bindfs DEBUG=1

2 - Create a volume

$ docker volume create -d lebokus/bindfs -o sourcePath=$PWD -o map=$UID/0:@$UID/@0 [-o <any_bindfs_-o_option> ] bindfsvolume

$ docker volume ls
DRIVER              VOLUME NAME
local               2d75de358a70ba469ac968ee852efd4234b9118b7722ee26a1c5a90dcaea6751
local               842a765a9bb11e234642c933b3dfc702dee32b73e0cf7305239436a145b89017
local               9d72c664cbd20512d4e3d5bb9b39ed11e4a632c386447461d48ed84731e44034
local               be9632386a2d396d438c9707e261f86fd9f5e72a7319417901d84041c8f14a4d
local               e1496dfe4fa27b39121e4383d1b16a0a7510f0de89f05b336aab3c0deb4dda0e
lebokus/bindfs      bindfsvolume

3 - Use the volume

$ docker run -it -v bindfsvolume:<path> busybox ls -la <path>

docker-compose example

Please note that the $UID variable is a bash and not a system variable. Fix it with

export UID
version: '2'
services:
    app:
        image: busybox
        command: "ls -la /mnt/test"
        volumes:
          - data:/mnt/test

volumes:
    data:
        driver: lebokus/bindfs:latest
        driver_opts:
            sourcePath: "${PWD}"
            map: "${UID}/0:@${UID}/@0"

LICENSE

MIT

docker-volume-bindfs's People

Contributors

clecherbauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-volume-bindfs's Issues

VolumeDriver.Mount: exit status 1

When I run:

docker volume create --driver lebokus/bindfs:latest -o sourcePath=$PWD -o map=$UID/1000:@$UID/@1000 some_volume > /dev/null
docker run -v some_volume:/home/ ubuntu:20.04     

I experience:

docker: Error response from daemon: VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[]).

This may be connected with this issue and this issue

(Reproduced on Mac OS Catalina 10.15.7, Docker version 20.10.10, latest version of bindfs plugin)

Very verbose "error" messages that don't seem to be errors

@lebokus Firstly, thanks for this plugin. :)

In the docker logs (using docker in docker), I see logs of examples of

time="2021-08-24T17:18:47Z" level=error msg="2021/08/24 17:18:47 Entering go-plugins-helpers getPath" plugin=61cd6bca634b9df27c29b4c824873d3afa87ab0dedb49b8149cfd3570579ff6c
time="2021-08-24T17:18:47Z" level=error msg="2021/08/24 17:18:47 Entering go-plugins-helpers capabilitiesPath" plugin=61cd6bca634b9df27c29b4c824873d3afa87ab0dedb49b8149cfd3570579ff6c
time="2021-08-24T17:18:47Z" level=error msg="2021/08/24 17:18:47 Entering go-plugins-helpers capabilitiesPath" plugin=61cd6bca634b9df27c29b4c824873d3afa87ab0dedb49b8149cfd3570579ff6c
time="2021-08-24T17:18:47Z" level=error msg="2021/08/24 17:18:47 Entering go-plugins-helpers getPath" plugin=61cd6bca634b9df27c29b4c824873d3afa87ab0dedb49b8149cfd3570579ff6c
time="2021-08-24T17:18:47Z" level=error msg="2021/08/24 17:18:47 Entering go-plugins-helpers capabilitiesPath" plugin=61cd6bca634b9df27c29b4c824873d3afa87ab0dedb49b8149cfd3570579ff6c

These don't seem to cause any negative effects and I've not set the DEBUG flag.

Is it possible to silence these messages?

Clarify options

Cool plugin!

Reading through the code, it looks like the driver_opts (other than sourcePath) translate directly to the options passed into bindfs (1). Would be good to document that in the readme.

No longer able to use this plugin without sudo

Hello,

I used this plugin quite a long time but unfortunately I don't get it to run on an updated machine. I use Ubuntu on a normal desktop PC. Nothing special here.

I followed these steps to install docker:

It doesn't matter if I try to install this plugin before or after the post-installation process

Distro/Version:
Ubuntu 21.10

Installation gives:

$ docker plugin install lebokus/bindfs

Plugin "lebokus/bindfs" is requesting the following privileges:
 - mount: [/var/lib/docker/plugins/]
 - mount: [/]
 - device: [/dev/fuse]
 - capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
latest: Pulling from lebokus/bindfs
Digest: sha256:70e32e400cf4fe1c58cee67e651067d949d724fd2c7d0e9e77a44e5650c0d289
dcac74e2a670: Complete 
Error response from daemon: dial unix /run/docker/plugins/92f03adaea02541d5b87f37afa298de9d59317f73db35935a8fc0ab6b7276c6e/bindfs.sock: connect: no such file or directory

In /run/docker/plugins there is another hash belonging to root when I install the plugin with sudo.

sudo docker-compose up -d is giving:

Cannot create container for service php: VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

docker-compose.yml:

version: "3.7"
services:
  nginx:
    [...]
    volumes:
      - docker-share:/var/www/html/
      [...]
    working_dir: /var/www/html/

docker-compose.override.yml:

version: "3.7"
volumes:
  docker-share:
    driver: lebokus/bindfs
    driver_opts:
      sourcePath: "${pwd}/www/html"
      map: "${UID:-1000}/33:@${UID:-1000}/@33"

What did I miss?

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.