machine-drivers / docker-machine-driver-xhyve

docker-machine/minikube/minishift driver plugin for xhyve/hyperkit (native macOS hypervisor.framework)
https://godoc.org/github.com/machine-drivers/docker-machine-driver-xhyve
BSD 3-Clause "New" or "Revised" License
888 stars 74 forks source link

Volumes not working #126

Open a0s opened 8 years ago

a0s commented 8 years ago

Hi! i have not working volumes with xhyve and docker-machine

docker -v
Docker version 1.11.1, build 5604cbe
docker-machine ls
NAME     ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
xhyve    *        xhyve        Running   tcp://192.168.64.3:2376             v1.11.1
eval $(docker-machine env xhyve)
cd ~
mkdir should_mapped
touch should_mapped/this_file
docker run -t -d -v ~/should_mapped:/root/should_mapped --name mapping_test ubuntu

docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
aa7374ae686d        ubuntu              "/bin/bash"         4 minutes ago       Up 4 minutes                            mapping_test

docker inspect mapping_test
...
        "Mounts": [
            {
                "Source": "/Users/orangeudav/should_mapped",
                "Destination": "/root/should_mapped",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
...

docker exec -it mapping_test ls /root/should_mapped
> NOTHING!

And the question is what i missed ? Same test with virtualbox driver working ok!

jpapejr commented 8 years ago

Do a docker-machine ssh xhyve and browse to where you think the file should be. You'll probably find it in the VM but not one your host. This is the behavior I'm seeing unless you create the xhyve machine with the NFS option noted in the README

dearfrankg commented 7 years ago

Not working for me

Strech commented 7 years ago

@orangeudav @dearfrankg check out your NFS daemon. Restart it and check that the /etc/exports has the proper definition

# BEGIN: docker-machine-driver-xhyve default
/Users 192.168.64.5 -alldirs -mapall=username
# END: docker-machine-driver-xhyve default
hh3755 commented 5 years ago

After you use xhyve, then you will got a VM running as your docker host.

You should use docker-machine ssh xhyve login to your VM and check your mapping file.

@jpapejr is right. using ls / to check all your VM files.