Exposing a fuse mount point to another container

2,433 views
Skip to first unread message

akshay rao

unread,
Jul 31, 2014, 4:25:57 PM7/31/14
to docke...@googlegroups.com
Hi,
I know how to expose a container's private directory to the outside world using -v, however this is not working for a fuse mount point

In my container, I have mounted a directory /mnt/test as a fuse mount point (fuse is brought up in the context of that container)

When I access that directory outside the container, it is not going through fuse... rather I just see an empty directory.

How do I make the access of that directory from the outside to also go through the fuse instance?

AR

James Mills

unread,
Jul 31, 2014, 5:02:49 PM7/31/14
to akshay rao, docker-dev
Correct me if I'm wrong but I thought bind mounted volumes
worked in the direction of host -> container?

cheers
James

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harshavardhana

unread,
Jul 31, 2014, 8:02:05 PM7/31/14
to James Mills, akshay rao, docker-dev
On Thu, Jul 31, 2014 at 2:02 PM, James Mills
<prol...@shortcircuit.net.au> wrote:
> Correct me if I'm wrong but I thought bind mounted volumes
> worked in the direction of host -> container?
>

This is in-fact correct not the other way round.

--
Religious confuse piety with mere ritual, the virtuous confuse
regulation with outcomes

fake rao

unread,
Jul 31, 2014, 9:05:46 PM7/31/14
to James Mills, docker-dev
They work both ways, I am surely able to expose a local directory to the host as well.

The only problem is, if I fuse mount on that directory, the host's IO do not go through fuse but straight to the local directory instead.

AR


On Thu, Jul 31, 2014 at 2:02 PM, James Mills <prol...@shortcircuit.net.au> wrote:

James Mills

unread,
Jul 31, 2014, 11:22:04 PM7/31/14
to fake rao, docker-dev

On Fri, Aug 1, 2014 at 11:05 AM, fake rao <fakem...@gmail.com> wrote:
They work both ways, I am surely able to expose a local directory to the host as well.

How?

fake rao

unread,
Aug 1, 2014, 1:56:19 AM8/1/14
to James Mills, docker-dev
I'm sorry for my wrong information... actually the containers filesystem is alway accesible locally by going to where docker rooted the container.

On the host, if I go to /var/lib/docker/btrfs/subvolumes/XXX, where XXX is the container ID obtained via docker inspect , I see the containers data.  

If the container does a fuse mount however, I do not see the fuse mounts data


I need a way where the host and therefore any other container can see this containers local directory which has been fuse mounted.


Shannon Mann

unread,
Aug 1, 2014, 2:16:21 AM8/1/14
to docke...@googlegroups.com, prol...@shortcircuit.net.au
I am fairly confident you can't - it isn't supported (may not be able to be supported).

Docker inspect on the container tells you plenty.  To understand volumes, I'd suggest playing with the inspection of the container.

When you have a part of the disk as a Dockerfile VOLUME, you can see it in the host-side /var/lib/docker directory for that container. 
If you 'docker run' with a -v option, that will also be host-side where you specified.  Two examples I have for a foswiki container (using 'docker inspect'):
    "Volumes": {
        "/foswiki": "/opt/docker/foswiki",
        "/var/www/foswiki": "/var/lib/docker/vfs/dir/32599903467bac2a1da694ad6cf8cfd7debc132de2b519d9044292f17feb4553"
    },

client-side '/foswiki' was created with a 'docker run -v' argument with specified local and client directories.  client-side '/var/www/foswiki' was created by a Dockerfile 'VOLUME' declaration.  Note both are visible host-side.

Even --volumes-from doesn't help, as you still get the above entries in the 'inspection' of a container using --volumes-from.

When using Fuse, you are not in kernel space, so I am pretty sure the docker daemon knows nothing of the internals of said filesystem.

You MIGHT be able to do a Fuse filesystem on the host and use 'docker run -v' to expose it to the appropriate containers.  Still puts the filesystem out of root space and allows the sharing.

Thanks.

Shannon

Shannon Mann

unread,
Aug 1, 2014, 2:55:57 AM8/1/14
to docke...@googlegroups.com, prol...@shortcircuit.net.au
A bit of digging shows:
Can't use FUSE with Docker

Apparently, a compile-time change can enable FUSE.  Don't know if that will achieve what you desire.

Thanks.

Shannon

James Mills

unread,
Aug 1, 2014, 5:08:36 AM8/1/14
to akshay rao, docker-dev
I hate to point out the obvious but the way you're "trying" to do this
seems broken, inconsistent and non-repeatable.

Could you not expose the FUSE mount point of Contienr A
over WebDAV to Container B as a normal WebDAV service
thereby ensuring reliability and repeatability?

Why hack around the internals of Docker/BTRFS (which were never designed for this)?

cheers
James
On Fri, Aug 1, 2014 at 6:25 AM, akshay rao <fakem...@gmail.com> wrote:

--

fake rao

unread,
Aug 1, 2014, 1:22:32 PM8/1/14
to James Mills, docker-dev
Yes, I can use webdav or even NFS (which I have working this way) but this ads another hop to get to what is a local share...

Thanks
AR

James Mills

unread,
Aug 1, 2014, 5:56:49 PM8/1/14
to fake rao, docker-dev
I

On Sat, Aug 2, 2014 at 3:22 AM, fake rao <fakem...@gmail.com> wrote:
Yes, I can use webdav or even NFS (which I have working this way) but this ads another hop to get to what is a local share...

It's more repeatable than what you were trying to do hwoever
which is kind of the whole point of Docker and it's ecosystem.
Reply all
Reply to author
Forward
0 new messages