You are not logged in.

#1 2017-10-25 03:34:33

wushuzh
Member
Registered: 2015-08-19
Posts: 14

why local bind mount not work with container on docker machine

Hello,

my container volume bind mount is not working.

I have created a docker machine named "dev". I want to share the local folder/files with the container on dev.

But I cannot see any local file.

 
$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
dev    *        virtualbox   Running   tcp://192.168.99.100:2376           v17.10.0-ce   

[wushuzh@zion ~]$ mkdir try-mount
[wushuzh@zion ~]$ cd try-mount/
[wushuzh@zion try-mount]$ pwd
/home/wushuzh/try-mount
[wushuzh@zion try-mount]$ touch hello-container
[wushuzh@zion try-mount]$ ls -lrt
total 0
-rw-r--r-- 1 wushuzh users 0 Oct 25 11:26 hello-container
[wushuzh@zion try-mount]$ docker run -it -v $(pwd):/mnt ubuntu bash
root@8bf8ffe8bc3e:/# ls -lrt /mnt
total 0

From docker inspect, I can see that mount is set.

 
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/wushuzh/try-mount",
                "Destination": "/mnt",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

On the other way, I can see that vboxsf is working on VM dev, I can see the local file in VM.

Does that mean that problem is between VM and container ?

How should I continue with this investigation ?

 
$ docker-machine ssh dev
...
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 17.10.0-ce, build HEAD : 34fe485 - Wed Oct 18 17:16:34 UTC 2017
Docker version 17.10.0-ce, build f4ffd25
docker@dev:~$ ls -lrt /hosthome/wushuzh/try-mount/
total 0
-rw-r--r--    1 docker   staff            0 Oct 25 03:26 hello-container

Best regards,
wushuzh

Offline

#2 2019-08-09 03:40:33

ethanmiller
Member
Registered: 2019-08-09
Posts: 1

Re: why local bind mount not work with container on docker machine

Hi, did you figure this out?

Offline

#3 2019-08-09 07:17:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: why local bind mount not work with container on docker machine

This thread is nearing two years  old and the OP hasn't been here for a year, please open up your own thread detailing the information from your own system if you need assistance, don't necrobump

Closing.

Offline

Board footer

Powered by FluxBB