{"action":"opened","issue":{"url":"https://api.github.com/repos/contiv/volplugin/issues/300","repository_url":"https://api.github.com/repos/contiv/volplugin","labels_url":"https://api.github.com/repos/contiv/volplugin/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/contiv/volplugin/issues/300/comments","events_url":"https://api.github.com/repos/contiv/volplugin/issues/300/events","html_url":"https://github.com/contiv/volplugin/issues/300","id":159280916,"number":300,"title":"Option to Mount Volume at Sub Directory","user":{"login":"quater","id":2474146,"avatar_url":"https://avatars.githubusercontent.com/u/2474146?v=3","gravatar_id":"","url":"https://api.github.com/users/quater","html_url":"https://github.com/quater","followers_url":"https://api.github.com/users/quater/followers","following_url":"https://api.github.com/users/quater/following{/other_user}","gists_url":"https://api.github.com/users/quater/gists{/gist_id}","starred_url":"https://api.github.com/users/quater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quater/subscriptions","organizations_url":"https://api.github.com/users/quater/orgs","repos_url":"https://api.github.com/users/quater/repos","events_url":"https://api.github.com/users/quater/events{/privacy}","received_events_url":"https://api.github.com/users/quater/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-08T21:46:17Z","updated_at":"2016-06-08T21:46:17Z","closed_at":null,"body":"I started to evaluate Volplugin today and really like it. Great work!\r\n\r\nVolplugin is a strong contenter for my project and I am wondering whether you would consider the following feature request.\r\n\r\n### Status Quo\r\n\r\nVolplugin allows to mount volumes at their root location as Docker does equally.\r\n```\r\n$ docker run -it -v policy/drive:/drive:ro ubuntu /bin/bash\r\n```\r\n\r\n### The Problem\r\n\r\nI would like to be able to mount a volume at a given sub directory position. The reason being is that I want to have one volume that is shared across numerous containers but each container only gets to see data from a particular sub directory or gets files mounted directly.\r\n\r\nIn my particular use case the volume is used in a micro services setting and holds dynamically generated configuration files for a number of containers/ services. I don't want that containers have access (not even read-only) to configuration files that belong to other containers for security purposes.\r\n\r\nAt present I can archive this will following hack but I would prefer a cleaner method.\r\n```\r\n$ docker run -it -v policy/drive:/drive:ro -v /mnt/ceph/rbd/policy1/drive/etc/nginx/conf.d/web.conf:/etc/nginx/conf.d/web.conf:ro ubuntu /bin/bash\r\n```\r\n> Note: The `-v policy/drive:/drive:ro` option will cause Volplugin to create a local mount on the Docker host at `/mnt/ceph/rbd/policy1/drive`, which is then used by the second mount option.\r\n\r\n### Proposed Feature\r\n\r\nIdeally I thought we could have something like this...\r\n```\r\n$ docker run -it -v policy/drive/etc/nginx/conf.d/web.conf:/etc/nginx/conf.d/web.conf:ro ubuntu /bin/bash\r\n```\r\n..., but that is not possible to implement without Docker's help since they don't allow slashes in the volume name. (see https://github.com/docker/docker/issues/17734)\r\n\r\nHowever the below syntax should be possible to implement.\r\n```\r\n$ docker run -it -v policy/drive_._etc_._nginx_._conf.d_._web.conf:/etc/nginx/conf.d/web.conf:ro ubuntu /bin/bash\r\n```\r\n\r\nI know this is not overly elegant due to the necessity of signifying the sub directory/ file path by using the `_._` annotation but it seems feasible.\r\n\r\nI have been poking around and currently see the following two starting points for implementing this.\r\nhttps://github.com/contiv/volplugin/blob/master/volplugin/init.go#L52\r\nhttps://github.com/contiv/volplugin/blob/master/volplugin/handlers.go#L61\r\n\r\nWhat is your standpoint?"}}
{"actor":{"display_login":"quater"}}