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

feature request: mount host volumes into docker driver via docker -v #7604

Closed
ptramsey opened this issue Apr 11, 2020 · 10 comments · Fixed by #8159
Closed

feature request: mount host volumes into docker driver via docker -v #7604

ptramsey opened this issue Apr 11, 2020 · 10 comments · Fixed by #8159
Assignees
Labels
co/docker-driver Issues related to kubernetes in container help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@ptramsey
Copy link

Steps to reproduce the issue:

  1. minikube config set vm-driver docker
  2. minikube start

This is a feature request; there's no failed command here to document. That said:

It would be really nice if the docker vm-driver allowed mapping paths from the local filesystem into the minikube container, using docker's volume binding functionality. E.g.,

minikube  config set vm-driver docker
minikube start --docker-volume=/home/ptramsey:/home/ptramsey

... which would internally call something like,

docker run -v /home/ptramsey:/home/ptramsey gcr.io/k8s-minikube/kicbase:v0.0.8 /usr/local/bin/entrypoint

As it is, despite running without virtualization on linux (which has a noticeable performance advantage), we're stuck using nfs or 9p to mount host paths inside minikube, both of which are slower (the latter of which is much slower) than just mapping the path directly via docker.

@medyagh medyagh added co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 11, 2020
@priyawadhwa
Copy link

Hey @ptramsey thanks for opening this issue -- this seems like a reasonable feature request. If anybody would be interested in working on this, please comment here!

@priyawadhwa priyawadhwa changed the title vm-driver: docker does not support mapping local filesystem paths with -v feature request: mount host volumes into docker driver via docker -v Apr 15, 2020
@afbjorklund
Copy link
Collaborator

Currently we are mounting the /var directory as a docker volume, so that's the current workaround.

i.e. use this host directory, for getting things into the container ?

See e.g. docker volume inspect minikube for the details on it

Mounting the /home directory has security implications, some want it disabled by default for VMs...

See #6788

And #5012

@ptramsey
Copy link
Author

ptramsey commented Apr 20, 2020

Having the ability to specify arbitrary directories that aren't /var, though, is useful, and I would be surprised if people aren't already depending on that functionality, since the hyperkit driver on macos has it. Also, the virtualbox driver by default mounts /Users on macos and windows, and mounts /home to /hosthome on linux.

If people are concerned about mounting /home itself, to the extent that we think it should be completely disallowed (rather than just being a warning), it seems like this feature request could still be accomplished with that change. After all, the feature request doesn't refer to mounting /home anyway --- the example it presents is of mounting a specific home directory (that isn't /home/minikube).

@afbjorklund
Copy link
Collaborator

Agree, adding the possibility to add mounts in the docker/podman driver would be a nice feature.

@Asarew
Copy link
Contributor

Asarew commented May 15, 2020

/assign

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2020
@Asarew
Copy link
Contributor

Asarew commented Aug 13, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2020
@AlbertMarashi
Copy link

bump

@vincent-163
Copy link

Any progress on this? I stumbled upon this problem. It feels so hard to use Kubernetes local volumes without this feature.

@Asarew
Copy link
Contributor

Asarew commented Aug 2, 2021

@vincent-163 yes, this was fixed and merged a while ago #8159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants