Open christhomas opened 7 years ago
@christhomas Hi :)
Okay, now I'm little active to develop this project (sorry other issue users...) And develop that related the disk image. actually, implements qcow2 image format support with docker/hyperkit. So I also interested for the if disk i/o, or volume problems.
Your posted comment might be helpful to debug. Thanks for telling me much information.
Are there problems with docker volumes in general? should I go back to using virtualbox if I need this functionality?
I don't know whether it general. because I had to stop before development this project. but I think like it was a lot. xhyve-driver users posted many issues that disk image, shared folder and volume issue. Basically same layer. You will be seen that the multitude if you look at the other issue.(but I really don't see issue thread until recently. so I don't know it correct.)
Just an off topic. If you want to go back to virtualbox, I want to suggest the Docker for Mac. It almost the basic concept is the same as xhyve-driver. Maybe have the same issue, but faster than virtualbox and modern. There will be worth try. If you want to a stable, please use virtualbox.
Next, mainly topic. My debugging start point is I re-using the docker-compose. I do not use for a long time, because the bugs were many And I read your comment, there is also the possibility of other(not driver) causes. I will try your same environment and understand problem causes point.
Also, I want to know what setting that you did launch the xhyve.
Could you post a config json such as ~/.docker/machine/machines/foo/config.json
as much as possible? (cut the sensitive data If there)
@christhomas In case if you will enable --xhyve-experimental-nfs-share
you can quickly check mounting by
$ docker run -v "$PWD:/pwd" -it ubuntu ls -l /pwd
And in case if you will see empty folder, this will mean that you have some issues with nfs daemon, and you can try to restart it, or destroy the machine (it will stop the daemon) and create new one (it will strat the daemon)
@christhomas I want to make sure of something, which OS are you using as I have the same problem and I suspect it's because I'm running on OSX Seirra.
@blazeeboy: I am running Sierra yes @Strech I did not actually try it in the end, I will explain.
I spoke with the devops guy at my last company and they told me to get Docker for Mac, which does not use docker-machine anymore, which is still using the old boot2docker / virtual box combo.
So when I used docker from cask, or downloaded it from docker.com, I found that now volumes work, although one drawback is that I cannot build new machines, I am limited to a single machine it seems, so I cannot try out swarm.
I'm having the same issue running Sierra, the xhyve docker-machine gives an empty dir for volumes while virtualbox ones work as expected (files in volumes)
docker
, docker-machine
and docker-machine-driver-xhyve
are all installed from brew
Have tried to restart the docker machine but does not solve the problem, the volume folder is still empty
@otakustay sounds crazy, but if you will try to recreate created docker machine it should help, because probably for some reason you NFS daemon wasn't working correctly.
Can you try to rm
machine and create new one?
I'm new to docker (2 days total) so I tried to fresh install every environment to reproduce this issue:
brew install docker docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
docker-machine create -d xhyve default
eval $(docker-machine env default)
Ensure docker env is correct:
~/Dev » env | grep -i docker
DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.64.5:2376
DOCKER_CERT_PATH=/Users/otakustay/.docker/machine/machines/default
DOCKER_MACHINE_NAME=default
cd ~/Dev
mkdir docker-volume
cd docker-volume
docker build -t docker-volume .
The Dockerfile
contains simple instructions:
FROM nginx
RUN mkdir -p /usr/app
docker run --name docker-volume -v /Users/otakustay/Dev/docker-volume/:/usr/app -d docker-volume
docker exec -it docker-volume ls /usr/app
This outputs nothing (empty dir)
touch foo.txt
docker exec -it docker-volume ls /usr/app
Still nothing.
Docker for Mac and -d virtualbox
both work as expected (have files in volume)
I don't have any other module (like docker-machine-nfs
) installed, could it be the cause of this issue?
Any update about how fix this issue ?
Hi , @christhomas the problem of empty folder in Firewall. Just For test, turn off Firewall and restart docker-machine and docker-composer and you will see ;) As this NFS you should have open port for correct executable.
P.S.>let me know if this fix problem. Thanks
I actually stopped using the project when I started to use docker for mac, sorry I can't help you more with this
FYI - I was having this same issue, but using the --xhyve-experimental-nfs-share
flag when generating the docker machine fixed the issue...
I had the same issue, but then I figured out that in default settings sharing is disabled:
$ docker-machine inspect local
…
"Virtio9p": false,
"Virtio9pFolder": "/Users",
…
Just change Virtio9p to true and docker-machine restart
Run into this issue today and as mentioned above, the solution is:
docker-machine inspect ${machine_name}
~/.docker/machine/machines/${machine_name}
, modify config.json
, change that Virtio9p
setting to true
.docker-machine inspect ${machine_name}
After these, you should see the flag is changed by running docker-machine inspect ${machine_name}
To many people, the ${machine_name}
mentioned here should be default
Thanks @iBobik for this solution, you've saved my day! :D
Is this something that we can make a default? Is it something that we would want to be a default?
I'm new to VirtIO, but it seems like a standard that has good support.
If someone can point out where the default config.json
template is, I can take a look at a pull request.
A search through this repository only returned one file, xhyve/xhyve.go.
Try to change NFSSharesRoot
to /
in config.json
:
{
...
"NFSShares": [
"/private/var/srv"
],
"NFSSharesRoot": "/",
"Virtio9p": null,
"Virtio9pRoot": "/xhyve-virtio9p",
"NFSShare": true,
...
}
Also, at some moment i've changed NFSShare
to true
. May be it is important as well.
P.S. Be sure, you are not mounting folders in NFSShares
that are already exist in docker machine image.
Hi,
I have a strange issue where a docker volume I am mounting using docker-compose is partially empty, it contains one folder, but nothing more, but I am unsure why that folder is special and why it displays and the others do not display at all.
Are there problems with docker volumes in general? should I go back to using virtualbox if I need this functionality?
I have this service defined in my docker-compose.yml:
in my host operating system, if I do this: find ./projects, I get the following output:
lets assume, I have no docker machines configured, so lets make one using the command:
if I shell into it using the command:
then do the command a directory listing of the root I get the following output:
So, there is nothing mounted and no /Users folder, it will appear when I docker-compose up my service in a minute, but I just wanted to prove the machine is fresh and new.
Now in the terminal open in the docker-compose.yml folder, I execute the following two commands:
and I get the following output:
Then I bring up the container I want, by running this command:
And get the following output:
But now, in a new terminal, if I shell into the docker-machine again, and list the root directory, I find that "Users" has been added, so lets do "docker-machine ssh somecompany.lk" and see "ls /" again
and if I do a find /Users, I get the following output:
But now I am confused, since when I did the docker-compose up, it appears to have found the absolute path to the location I wanted to mount and this appears in the docker-machine, but where are all the contents of ./projects ? remember it should display a couple of directories, hello, test and two files, index.php and testing.php, but they are not there!
So ok, lets open a bash terminal into the container and see what is there in the /var/www folder, I can find the name using docker ps and using the last column in the row, in my case, its "somecompanystack_test_nginx_php_lk_1"
and then we can find /var/www to see what files are there
Nothing, its empty, what about du -sh
So it is literally empty and has no contents at all, which I guess should be expected because I suppose docker-machine has the mountpoint in its system and it maps it into the container, since in docker-machine it was empty, I suppose here it would be too, right?
So, if I create a file in this folder, will it appear in the docker-machine?
yes it will, but does it appear in the correct location in the docker-machine
yes it does.....but because this volume is supposed to be mapped from the host, I wonder if the file is present there?
Nope, so this apparently is not working as expected, its got the right directory structure, but there are no contents even though they are mapped between them, yet nothing is coming from the host into the docker machine or container.
And just so you have all the information, here is the output from docker inspect: