Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Automatically mount home directory in init script #84

Closed
bfirsh opened this issue Jan 16, 2014 · 12 comments
Closed

Automatically mount home directory in init script #84

bfirsh opened this issue Jan 16, 2014 · 12 comments

Comments

@bfirsh
Copy link
Contributor

bfirsh commented Jan 16, 2014

Shared folders is one of the things that is stopping me from switching myself and Fig from docker-osx. It's essential for using Docker in development.

The way we have it set up for docker-osx is it mounts your home directory into the same place inside the VM. So, for example, /Users/ben on OS X is mounted at /Users/ben inside the VM. This works brilliantly for Docker volumes, because I can do run like docker run -v .:/code ... and it Just Works because . expands to /Users/ben/....

I see there are plans to get NFS working in #64, but are there plans to do a similar automatic NFS mount for boot2docker? Or a better question perhaps – are there any objections to doing this? Because I'd quite like to do it. ;)

@aheissenberger
Copy link
Contributor

You could look into the option to partial install the vbox guest additions with only sharing activated.

On Thu, Jan 16, 2014 at 8:11 PM, Ben Firshman notifications@github.com
wrote:

Shared folders is one of the things that is stopping me from switching myself and Fig from docker-osx. It's essential for using Docker in development.
The way we have it set up for docker-osx is it mounts your home directory into the same place inside the VM. So, for example, /Users/ben on OS X is mounted at /Users/ben inside the VM. This works brilliantly for Docker volumes, because I can do run like docker run -v .:/code ... and it Just Works because . expands to /Users/ben/....

I see there are plans to get NFS working in #64, but are there plans to do a similar automatic NFS mount for boot2docker? Or a better question perhaps – are there any objections to doing this? Because I'd quite like to do it. ;)

Reply to this email directly or view it on GitHub:
#84

@bfirsh
Copy link
Contributor Author

bfirsh commented Jan 17, 2014

Virtualbox shared folders are very slow though. I'd much get NFS (or similar) working which doesn't need the Virtualbox guest additions.

@aheissenberger
Copy link
Contributor

You can try this #87 to activate NFS Server & Client but I have not found a simple solution without modifying the docker code to mount the current home directory

@bfirsh
Copy link
Contributor Author

bfirsh commented Mar 26, 2014

#284 looks like it might help with this.

@lazywei
Copy link

lazywei commented Apr 1, 2014

Really need this feature, the shared folder is really important.
Will this be merged?

@steeve
Copy link
Contributor

steeve commented Apr 23, 2014

use #284 for now

@SvenDowideit
Copy link
Contributor

we're making boot2docker as simple and small as possible - so at this point, adding tools that are not relevant to all usecases (bare HW, vbox, vagrant, hyper-v, vmware, kvm, etc) is not on the plan. This may change in future, but we havn't completed our original feature set yet.

@jmmills
Copy link

jmmills commented May 30, 2014

It seems like the real underlying issue here (at least in my fiddling with trying to get similar things to work) is that the relative paths are not transparent.
To make it seem (under OSX) like your working with a native docker service it would seem that you would want the workflow to behavior like this:

$ boot2docker up
...
$ cd ~/some/project/dir/
$ docker run -t -i -v $CWD:/some/working/dir $image

I think in my case the biggest help to make a work around is actually an issue with the docker client communicating to boot2docker and the docker service.
If I could just tell docker (or fig) that . needs to be mounted in boot2docker (at runtime?) and used as a volume that would help to make things seamless.

So really something like this would be optimal:

$ boot2docker up
...
$ cd ~/some/project/dir
$ grep WORKDIR Dockerfile
WORKDIR /project
$ cat fig.yml
dev:
  build: .
  volumes:
    - .:/project
  command: test
$ fig up

Kind of an interesting problem.

@jmmills
Copy link

jmmills commented May 30, 2014

^ at least my thinking is that it would keep things orthogonal between docker's run and build verbs when using boot2docker.

@steeve
Copy link
Contributor

steeve commented Jun 4, 2014

@jmmills look at #284

@jmmills
Copy link

jmmills commented Jul 1, 2014

@steeve Sure, but what I'm really saying is that this should be something included in the core feature set. Accessing volume data is a core and heavily used feature in docker, this boot2docker shouldn't hobble the tool it's built to support.

My input was directed at the fact that this needs to be (IMHO) more than a work around.

@jmmills
Copy link

jmmills commented Jul 2, 2014

Actually I'll try my luck writing a patch to allow for post-init hooks, this would be lite and simple but allow people share setup recipes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants