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

BUG: Minikube docker daemon doesn't mount all subdirectories #3001

Closed
ddeep2007 opened this issue Jul 20, 2018 · 3 comments
Closed

BUG: Minikube docker daemon doesn't mount all subdirectories #3001

ddeep2007 opened this issue Jul 20, 2018 · 3 comments
Labels
area/mount co/hyperkit Hyperkit related issues kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. os/macos priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@ddeep2007
Copy link

ddeep2007 commented Jul 20, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Please provide the following details:

Environment:

Minikube version (use minikube version): v0.28.1

  • OS (e.g. from /etc/os-release): macos High Sierra 10.13.4
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyperkit
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION):minikube-v0.28.1.iso
  • Install tools:
  • Others:
    The above can be generated in one go with the following commands (can be copied and pasted directly into your terminal):
minikube version
echo "";
echo "OS:";
cat /etc/os-release
echo "";
echo "VM driver": 
grep DriverName ~/.minikube/machines/minikube/config.json
echo "";
echo "ISO version";
grep -i ISO ~/.minikube/machines/minikube/config.json

What happened:
To generate a container of our service we run the build in a docker build container where we mount the current workspace to a folder called /go/src/pkg on the container. If we run the docker build command on the native docker for mac all the subdirectories of the workspace show up correctly. But once I run eval $(minikube docker-env) pointing to the minikube docker daemon only a single subdirectory shows up with the remaining subdirectories not being mounted.

The image below shows a narrow repro where the directories print in the mount with the minikube docker daemon are different from the ones mounted by native docker daemon.

The exact steps performed are below

  1. ls -alh -> the OS's view of the current directory which is going to be mounted
  2. make container -> which does a build of the container using the native docker daemon
  3. eval $(minikube docker-env) -> switch to the minikube docker daemon
  4. make container -> build the container again with the minikube docker daemon

image

What you expected to happen: The same set of subdirectories should be mounted by the native docker for mac and the minikube docker daemons.

How to reproduce it (as minimally and precisely as possible):

  • Create a make file with the below command and run make on it.
	@docker run                                                             \
	    -ti                                                                                          \
	    --rm                                                                \
	    -u $$(id -u):$$(id -g)                                              \
	    -v "$$(pwd):/go/src/$(PKG)"                                         \
	    -w /go/src/$(PKG)                                                   \
	    $(BUILD_IMAGE)                                                      \
	    ls -alh /go/src/$(PKG)                                               \

Output of minikube logs (if applicable):

Anything else do we need to know:

@tstromberg tstromberg added area/mount os/macos co/hyperkit Hyperkit related issues kind/bug Categorizes issue or PR as related to a bug. labels Sep 18, 2018
@WakeupTsai
Copy link

I think the minikube docker daemon will mount the volume which is in minikube(vm). So you have to mount your folder(host) into minikube(vm) first (use minikube mount), so the docker can access it.

@tstromberg tstromberg added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Jan 24, 2019
@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 Apr 29, 2019
@tstromberg
Copy link
Contributor

I think @WakeupTsai is correct. You will need to use "minikube mount" first. Please re-open if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mount co/hyperkit Hyperkit related issues kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. os/macos priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

5 participants