-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
Man, I wish we had plugins, but the outline is good. |
Going through the code, I'm wary of adding things to the driver. Other than for hypervisor shares, there's no real reason for driver additions. I wonder if there's a better way. |
941de2c
to
c9d889c
Compare
OK I've updated it a bit from the original implementation - now no new methods have been added to the drivers to implement this. It's a bit better in this form and pretty much completely ready for other share drivers to be implemented, so I might take a crack at an NFS share. |
c9d889c
to
cc8c30f
Compare
func NewShare(shareType, absPath string) (Share, error) { | ||
switch shareType { | ||
case "vboxsf": | ||
return VBoxSharedFolder{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just use NewShareWithOptions
here
I like this idea. However, right now I want to focus on getting the provisioner and related (cloudinit, etc). We will need to heavily review and vet as this affects core functionality and workflow from all Docker users using this for local dev. We will probably want to involve the kitematic team as they could provide valuable feedback from a local dev and requirement standpoint. /cc @JeffDM |
I agree that's more important, I want to focus some time on getting that stuff in good shape first before making a big push to get this merged.
+1 |
Absolutely, I'd love to get my PRs merged to work on new things |
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
cc8c30f
to
0e42258
Compare
It doesn't really work yet. Beware Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
Howdy! I would really like this functionality. Is there anything I can do to help it move forward? Looking at the comments, it mainly looks like its blocked on coordinating with other teams and generating the right documentation to inform folks of the change? |
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
Big 👍 I'd love to use NFS with docker-machine ! |
I should add the BIG BOLD CAVEAT for anyone considering trying this code out that the NFS driver doesn't really work yet and it's "use at your own risk" (I almost had some issues with data loss playing around with it), however if anyone is brave enough to consider helping I'm available on IRC: nathanleclaire (I do intend to pick it up again at some point) |
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This is addressing the very problem I'm struggling with today. Adding @ahmetalpbalkan to see if he has any thoughts from a Hyper-V and Azure perspective. |
for docker 1.7 experimental, there's also https://github.com/SvenDowideit/docker-volumes-nfs |
We need to really think carefully about how/when this might be implemented, so I'm closing this for now. |
wait for disks to actually exist, closes docker#793
cc @bfirsh @ehazlett @sthulb @SvenDowideit @tianon
Hi, this is nowhere near complete, but I wanted to show what I have done so far so we can talk about it, explain the motivations, and hopefully then we can move forward with a clean and clear design.
Motivation
This has been discussed ad nauseum, so I won't rehash too much, but rather summarize quickly.
The only currently supported method for sharing folders between machine host and created machines is to auto-mount
/Users
as a VirtualBox shared folder in the boot2docker VM. This has some issues:inspect
.This is a continuation of the before-mentioned
docker-machine share
proposal: #179.Implementation
So far, just to get something together, I've just done VBox shared folders, and need some help on the design for making this a more generic interface.
Example usage with this PR:
The code is kind of fun; essentially, in
cmdShare
I check to see if the driver fulfills theDriverWithShares
interface. If it doesn't (every driver except VBox), I error out, but if it does, we go ahead and create the share. This requires us to do things like stopping and starting the machine, which is why in the proposed interface in the next section you pass in theDriver
to some of the commands.Future
Instead of having things sort-of-hardcoded like I do now, I think that where I'd like to move is to have a
type Share interface
which provides all the methods needed to create and maintain the share throughout a machine's lifecycle. Then there would betype VboxsfShare struct
,type NfsShare struct
, etc. which would all be managed through common code.E.g.:
ContractFulfilled
would check to see if the share can actually be created / used. "Are the Guest Additions installed? Is NFS installed?" etc.Host
'sStart
method would be extended slightly to support doing the mounts at start time:This isn't super elegant (the problem is really hairy all around), but it'd be a start.
Instead of trying to jump into supporting shares on all drivers all at once, we could do them piecemeal by slowly implementing the
DriverWithShares
interface on a per-driver basis. That way, we could start with getting the basic idea right for local drivers (easier) and expand the reach gradually. Hopefully this can help with some of the concern over bringing them to remote providers as well: if it turns out that we're happy with just the local versions, then no need to implement the interface for the remaining drivers.I really want to enable a mechanism whereby this kind of thing can be done:
$ docker-machine share --with foomachine --driver vboxsf --uidmap $(whoami):apache .
To relieve the pain of users who cannot use our current method because their container runs as a non-root user (which, it should be noted, is a security best practice that we should be promoting heavily).
All this type of thing could be added to the proposed declarative syntax as well.
Clarifications
docker-machine
or in a separate tool, I think that unless proven otherwise having another tool would just be too much overhead and for convenience it should just all go in one tool (machine) for now.docker-machine scp
command which would handle bothscp
andrsync
to machines under management separately from these kinds of "two-way" shares.-v
, but that won't necessarily