Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker host volumes #94

Open
whitlockjc opened this issue Aug 11, 2016 · 9 comments
Open

docker host volumes #94

whitlockjc opened this issue Aug 11, 2016 · 9 comments
Labels

Comments

@whitlockjc
Copy link

Have you tried using docker run with a host volume? Within the docker container, the container directory is there but the contents are always empty. Here is an example:

$ docker run --rm --name build-dex -v $GOPATH:/go golang:latest ls -l /go
total 0

What I expect is this:

ls -l $GOPATH
total 0
drwxr-xr-x  38 notyou  staff  1292 Aug 10 16:11 bin
drwxr-xr-x   3 notyou  staff   102 Feb  2  2015 pkg
drwxr-xr-x  13 notyou  staff   442 Jul 14 15:13 src

This could be a Docker question but from what I can tell, it should work and I'm using the right syntax. Maybe my system needs a reboot...

@whitlockjc
Copy link
Author

I'm an idiot. The issue is that the host is not my OS X box but my CoreOS VM.

@whitlockjc
Copy link
Author

Wait, that's not totally true either because the CoreOS VM mounts this. But...I do think I read somewhere that Docker mounts and NFS do not play nicely so it would seem that is the issue. I verified this (to a degree) by mounting a non-NFS directory in the CoreOS VM and it works as expected.

@whitlockjc
Copy link
Author

whitlockjc commented Aug 11, 2016

I'm reopening this because I want to get your opinion on installing a Docker Volume Plugin to allow this: http://netshare.containx.io/docs/getting-started

@whitlockjc whitlockjc reopened this Aug 11, 2016
@rimusz
Copy link
Member

rimusz commented Aug 12, 2016

yes, docker sucks with NFS volumes in our case. never tried that Docker Volume Plugin,
I just usually end up doing rsync.
@AntonioMeireles what do you think?

@whitlockjc
Copy link
Author

whitlockjc commented Sep 2, 2016

I just ran into this again trying to build minikube against a custom build of Kubernetes:

if [ ! -e /Users/notyou/workspaces/personal/minikube/src/k8s.io/minikube/_gopath/src/k8s.io ]; then mkdir -p /Users/notyou/workspaces/personal/minikube/src/k8s.io/minikube/_gopath/src/k8s.io && ln -s -f /Users/notyou/workspaces/personal/minikube/src/k8s.io/minikube /Users/notyou/workspaces/personal/minikube/src/k8s.io/minikube/_gopath/src/k8s.io; fi
docker run -w /go/src/k8s.io/minikube -e IN_DOCKER=1 -v /Users/notyou/workspaces/personal/minikube/src/k8s.io/minikube:/go/src/k8s.io/minikube gcr.io/google_containers/kube-cross:v1.6.2-1 make out/localkube
make: *** No rule to make target 'out/localkube'.  Stop.
make: *** [out/localkube] Error 2

Following the "Updating Kubernetes" section of kubernetes/minikube, when I get to the point where I run make, I get the error above. This is because the approach minkube uses is to build within Docker using host volumes.

@whitlockjc
Copy link
Author

By the way, I'm not looking to leave kube-solo for minikube, I am trying to run a local developer build of Kubernetes. If you have a better way to do this...

@rimusz
Copy link
Member

rimusz commented Sep 6, 2016

@whitlockjc sorry been away for the conference, and too busy this week.
the best would be use rsync to copy code to VM and mount VM's drive to docker

@whitlockjc
Copy link
Author

If you've got an example, that would be cool. If not, I'll figure it out.

@rimusz
Copy link
Member

rimusz commented Sep 6, 2016

usually I trigger code copying with rsync via post commit hook

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

No branches or pull requests

2 participants