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

Volumes mouth a directory onto file #34167

Closed
MikhaelGerbet opened this issue Jul 18, 2017 · 23 comments

Comments

@MikhaelGerbet
Copy link

commented Jul 18, 2017

Description

"volumes mouth a directory onto file" since the last update

Steps to reproduce the issue:

  1. Update docker for windows
  2. docker-compose build/up

Describe the results you received:

docker-compose up
Starting docker_db_1 ...
docker_maildev_1 is up-to-date
Starting docker_db_1
docker_php_1 is up-to-date
docker_nginx_1 is up-to-date
Starting docker_db_1 ... error

ERROR: for docker_db_1 Cannot start service db: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused "rootfs_linux.go:57: mounting \"/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io/docker/mysql/my.cnf\" to rootfs \"/var/lib/docker/aufs/mnt/a009da3cf1fad75e49b599b897f4968b4148e02629e0b1702979c9b2fccb21a7\" at \"/var/lib/docker/aufs/mnt/a009da3cf1fad75e49b599b897f4968b4148e02629e0b1702979c9b2fccb21a7/etc/mysql/mysql.cnf\" caused \"not a directory\"""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for db Cannot start service db: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused "rootfs_linux.go:57: mounting \"/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io/docker/mysql/my.cnf\" to rootfs \"/var/lib/docker/aufs/mnt/a009da3cf1fad75e49b599b897f4968b4148e02629e0b1702979c9b2fccb21a7\" at \"/var/lib/docker/aufs/mnt/a009da3cf1fad75e49b599b897f4968b4148e02629e0b1702979c9b2fccb21a7/etc/mysql/mysql.cnf\" caused \"not a directory\"""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

Describe the results you expected:

Before the update, everything was stable

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:30:30 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:51:55 2017
 OS/Arch:      linux/amd64
 Experimental: true

Output of docker info:

Containers: 20
 Running: 4
 Paused: 0
 Stopped: 16
Images: 692
Server Version: 17.06.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 649
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.36-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: 7TIR:PVGX:FNVK:3A42:SSYN:U26M:2KOD:Y4R7:FTBJ:R2HA:JRVK:VUZW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 51
 Goroutines: 68
 System Time: 2017-07-18T21:19:02.0590364Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

docker-compose.yml

version: '2'

services:
    db:
        build: mysql
        volumes:
            - "./.data/db:/var/lib/mysql"
            - "./mysql:/data"
            - "./mysql/my.cnf:/etc/mysql/my.cnf"
        environment:
            MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
            MYSQL_DATABASE: ${MYSQL_DATABASE}
            MYSQL_USER: ${MYSQL_USER}
            MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    php:
        build: php7-fpm
        #mem_limit: 6MB
        ports:
            - 9000:9000
        links:
            - maildev
        volumes:
            - ${SYMFONY_APP_PATH}:/var/www/symfony
            - ./logs/symfony:/var/www/symfony/app/logs
    nginx:
        build: nginx
        ports:
            - 80:80
        volumes_from:
            - php
        volumes:
            - ./logs/nginx/:/var/log/nginx

    elk:
        image: willdurand/elk
        ports:
            - 81:80
        volumes:
            - ./elk/logstash:/etc/logstash
            - ./elk/logstash/patterns:/opt/logstash/patterns
        volumes_from:
            - php
            - nginx

    phpmyadmin:
            image: phpmyadmin/phpmyadmin
            ports:
                - "8080:80"
            links:
                - db
    maildev:
        image: djfarrelly/maildev
        ports:
            - "1081:80"
            - "1025:25"
        restart: always

Thx for your help

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 18, 2017

When i retrieve the mysql conf :
- "./mysql/my.cnf:/etc/mysql/my.cnf"

My stack gets started but - ${SYMFONY_APP_PATH}:/var/www/symfony not working in php container :/

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jul 19, 2017

What is ${SYMFONY_APP_PATH} set to? Does that path exist?

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 19, 2017

hi @thaJeztah , it's a env variable :

.env

SYMFONY_APP_PATH=../
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=hedwige
MYSQL_USER=dbuser
MYSQL_PASSWORD=123

because docker is in my app folder

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 19, 2017

any idea ?

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jul 19, 2017

The original error message;

Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

Seems to indicate the ./mysql/my.cnf was either not found, or the local disk was not shared with the VM in which the docker daemon runs.

When bind-mounting files from your host to a container, the bind-mount is always performed on the host that the daemon runs on, which in case of Docker for Mac and Docker for Windows, is a lightweight Virtual Machine.

To make it possible to bind-mount files from your Windows (or Mac) host, Docker for Windows uses "file sharing" to share your host with the VM, so that the daemon can access those files (see https://docs.docker.com/docker-for-windows/#shared-drives)

If the path you're trying to bind-mount is not shared with the VM, the docker daemon creates an empty-directory inside the VM (it doesn't know if my.cnf should be a file or a directory, because it can't find it), and bind-mounts that directory in the container.

If the path inside the container contains a file, this will fail, because you cannot mount a directory on top of a file, which is what the error message tells is happening.

To find out what's happening in your case;

  • verify that drive sharing is enable (https://docs.docker.com/docker-for-windows/#shared-drives)
  • verify that the paths you're trying to mount exist (and that the files exist on your local machine)
  • after starting the services, do a docker inspect of each service, and check if the paths are correct; look in the HostConfig.Binds and Mount section of the JSON output;
  "HostConfig": {
            "Binds": [
                "/Users/sebastiaan/Projects/test:/test2:rw",
                "/Users/sebastiaan/Projects/test:/test:rw"
            ],
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/Users/sebastiaan/Projects/test",
                "Destination": "/test2",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/Users/sebastiaan/Projects/test",
                "Destination": "/test",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

I suspect there's no bug at hand here, but let me know if the above helps finding the issue in your situation

@sfeher-paymentus

This comment has been minimized.

Copy link

commented Jul 19, 2017

Try perhaps stop and share the drive again ? In my case it was the anti-virus interfering..

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 19, 2017

thx @thaJeztah

Responses :

  • verify that drive sharing is enable > yes it's ok
  • verify that the paths you're trying to mount exist > yes it's ok
  • after starting the services, do a docker inspect > not possible on windows 10

But i repreat, my docker-compose.yml work's with a old version of docker (dec 2016) or on my other computer on Ubuntu

New information and new case (simple case) :

With a very light config like this :

version: "2"
services:
    php:
        build: php7-fpm
        ports:
            - 9000:9000
        volumes:
            - ../:/var/www/symfony

This "stack" get started but, the volumes conf fail !

i have un tree dir like this :

project
|_docker
    |_php7-fpm
        |_Dockerfile
    |_docker-compose.yml
|_app
|_bin
|_deploy
|_log
|_master
|_src
[...]

And when i look the shared folders in the php container like this :

docker-compose exec php bash
ls /var/www/symfony 

i found juste 2 folders

  • docker
  • app

juste this.

it is very frustrating, i'm blocked since 4 days and I not find the solution :/

Thank you for your help

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 19, 2017

@sfeher-paymentus thx for your proposition but... not work's in my case. And i have re-install completly docker/compose... same result :'(

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jul 19, 2017

Why is docker inspect not possible on windows?

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 20, 2017

Ok my bad. With a other console, docker inspect work's (like gitbash)
So, i have deleted all images and all containers.

Now, when i do docker inspect with the id of the php image, i have :

docker inspect 1c024610bd65
[
    {
        "Id": "sha256:1c024610bd65e974f967f23d35449c7abe2df6661e4ecf8ec2587e881965f41c",
        "RepoTags": [
            "docker_php:latest"
        ],
        "RepoDigests": [],
        "Parent": "sha256:25d7a139194af133404cb66e64b430fb7eef3d22550b106407b50ed56a614c35",
        "Comment": "",
        "Created": "2017-07-20T21:53:52.9535128Z",
        "Container": "ac902856ab414a28e262f632f72dc33437f36fa86ffeef0b512c4498ffe33171",
        "ContainerConfig": {
            "Hostname": "e11aa17d2971",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tlibpcre3-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "PHP_EXTRA_CONFIGURE_ARGS=--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie",
                "GPG_KEYS=1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3",
                "PHP_VERSION=7.0.21",
                "PHP_URL=https://secure.php.net/get/php-7.0.21.tar.xz/from/this/mirror",
                "PHP_ASC_URL=https://secure.php.net/get/php-7.0.21.tar.xz.asc/from/this/mirror",
                "PHP_SHA256=6713fe3024365d661593235b525235045ef81f18d0043654658c9de1bcb8b9e3",
                "PHP_MD5="
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) WORKDIR /var/www/symfony"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:25d7a139194af133404cb66e64b430fb7eef3d22550b106407b50ed56a614c35",
            "Volumes": null,
            "WorkingDir": "/var/www/symfony",
            "Entrypoint": [
                "docker-php-entrypoint"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.06.0-ce",
        "Author": "Mikhael GERBET <frollon.noir@gmail.com>",
        "Config": {
            "Hostname": "e11aa17d2971",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tlibpcre3-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "PHP_EXTRA_CONFIGURE_ARGS=--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie",
                "GPG_KEYS=1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3",
                "PHP_VERSION=7.0.21",
                "PHP_URL=https://secure.php.net/get/php-7.0.21.tar.xz/from/this/mirror",
                "PHP_ASC_URL=https://secure.php.net/get/php-7.0.21.tar.xz.asc/from/this/mirror",
                "PHP_SHA256=6713fe3024365d661593235b525235045ef81f18d0043654658c9de1bcb8b9e3",
                "PHP_MD5="
            ],
            "Cmd": [
                "php-fpm"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:25d7a139194af133404cb66e64b430fb7eef3d22550b106407b50ed56a614c35",
            "Volumes": null,
            "WorkingDir": "/var/www/symfony",
            "Entrypoint": [
                "docker-php-entrypoint"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 803386743,
        "VirtualSize": 803386743,
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:0d960f1d4fba2435d731fee5d1e68e25058bc1b22921bb95dbab98149548ce9e",
                "sha256:c4066de46cb205e3c828e4cc78e0b90a43df99702e9604a6367661d813bc66b8",
                "sha256:958c46160919e70abc1bfb62eac3eca9a3b011db9775a6b19394ee9fa4c4ae9a",
                "sha256:0d602ca90e36537075a7fb72f23301cfb540b71e4104fb400103ed56525f8cd3",
                "sha256:a90144eadcc0a5aba6577207eae16bcdd822c329b8690b82e35831f13560f9b6",
                "sha256:48adb90fd405ca082c455ed16366171aeb56ea49328090d94528139b69848f6b",
                "sha256:61d21cb2d709e2779e75ce4f239f9a9c3101733724a8eedc32c7f18ffb69736b",
                "sha256:cdf4dd152892c4501543c92fc18bc9b2e5365468a4edcbd2c0d4f28cd8aab1fc",
                "sha256:7bb2e1946fa9bc37d69a464137699e0aa68454674ecb716276225a7a4185ebbd",
                "sha256:e2c26eeca20d0994cf360fac493729f3281aabd8232aa895a0f51e8dfec3bcdf",
                "sha256:79a0f9817af9bc5cfbc00efbecfcf6604bbe3f467c3ba18d351c63e157c6a4ac",
                "sha256:0894f7aaaaff651247280e12caa2c84f61fba8e07e9ec9b2b209f3715185dea3",
                "sha256:c7049a73acf57ffe088634f6d91a4a53691574ee06db087fdd7c26b2d886e045",
                "sha256:d73d6dfab63341345bbfadf167d173efa8a478bdca0d95a0ab7171ce8130e298",
                "sha256:f37e39819e04d71ce32c6259a3ef695c5b39afa6cbce4f747a54ab142a080934",
                "sha256:9a3d4e2ecb2dc4abeff909046e82a3d0ede65877af3fcfe557f6b31453eb2a09",
                "sha256:4c3b792c70ef8e5dff97b20eeff93906e2f9b33cf8159cf01badb34fc5c7d82c",
                "sha256:d8ca25650a041dae40425788c378c6b00e14e358237ded9b06f4ff8d832238b5",
                "sha256:e87717a81c9307256d601a593e43e2f6abc50260866e76495c142f3dab022c50",
                "sha256:79b0efc52c069d10757381341e23169fed2b81c560e4e5df9c58d84689c8f0b6",
                "sha256:bb80319b9539041743f73674013e59e8fd3e489ec0954f328b7a6d1415c78f47",
                "sha256:794003222bde7fdd0b3432d49f3b7b52f320347b336f72f12d0657926296fdf9",
                "sha256:67785f1604d275a2c7396450d45b1d725d06488f97c09a01da345a23ee96d263",
                "sha256:c9d77e3b722a3303e62fbd64c2b7aa94536d702b51fefdcb60e4102f0cb4fadc",
                "sha256:f48fab2b81dda81dd2169ad0154c39505e3f1ca852233c78635c8e0bb48519c0",
                "sha256:d7178036cc4e48ace8e6fb1cee5f6b77dbb5a20db9b4cb8ed01b850c37af23e2",
                "sha256:59aef69712e39354df10d9d0bfc87ff9a7014bfb18297f159f5fc29a3eebb830",
                "sha256:82c7abff114ba46f7dd83a7106ab5d81043a5f7dc41b129eaa34b80deb97e1ce"
            ]
        }
    }
]

docker-compose.yml

version: "2"

services:
    php:
        build: php7-fpm
        ports:
            - 9000:9000
        volumes:
            - ../:/var/www/symfony

My tree :

project
|_docker
    |_php7-fpm
        |_Dockerfile
    |_docker-compose.yml
|_app
|_bin
|_deploy
|_log
|_master
|_src
[...]

when i do a ls /var/www/symfony in my php container :

root@6801ad70cea4:/var/www/symfony# ls
app  docker

It's not good. Before the update docker, I had all my folders.
I have changing nothing and this works on my ubuntu.

any idea ?

thank you

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 20, 2017

I think, that since the last docker update, the volume configuration (on windows) failled. What do you think ?

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jul 21, 2017

Oh, can you do an inspect of the container, not the image ?

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

Oh ! Sorry @thaJeztah . Ok i do this that night. i'm confuse :`)

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

docker inspect php container :

 docker inspect 6801ad70cea4
[
    {
        "Id": "6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b",
        "Created": "2017-07-20T21:53:53.261533Z",
        "Path": "docker-php-entrypoint",
        "Args": [
            "php-fpm"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 66939,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2017-07-20T21:53:53.9750852Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:1c024610bd65e974f967f23d35449c7abe2df6661e4ecf8ec2587e881965f41c",
        "ResolvConfPath": "/var/lib/docker/containers/6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b/hostname",
        "HostsPath": "/var/lib/docker/containers/6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b/hosts",
        "LogPath": "/var/lib/docker/containers/6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b/6801ad70cea4fd67990b2b3f483f6826f9fac35358f1c92673b766ebbb791d7b-json.log",
        "Name": "/docker_php_1",
        "RestartCount": 0,
        "Driver": "aufs",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io:/var/www/symfony:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "docker_default",
            "PortBindings": {
                "9000/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "9000"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": -1,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io",
                "Destination": "/var/www/symfony",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "6801ad70cea4",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tlibpcre3-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "PHP_EXTRA_CONFIGURE_ARGS=--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2",
                "PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie",
                "GPG_KEYS=1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3",
                "PHP_VERSION=7.0.21",
                "PHP_URL=https://secure.php.net/get/php-7.0.21.tar.xz/from/this/mirror",
                "PHP_ASC_URL=https://secure.php.net/get/php-7.0.21.tar.xz.asc/from/this/mirror",
                "PHP_SHA256=6713fe3024365d661593235b525235045ef81f18d0043654658c9de1bcb8b9e3",
                "PHP_MD5="
            ],
            "Cmd": [
                "php-fpm"
            ],
            "ArgsEscaped": true,
            "Image": "docker_php",
            "Volumes": {
                "/var/www/symfony": {}
            },
            "WorkingDir": "/var/www/symfony",
            "Entrypoint": [
                "docker-php-entrypoint"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "31381d1e9dae7e5fa653ad1d88aee60757c5537afa2bfd0ebc77f3ef941d01e6",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "docker",
                "com.docker.compose.service": "php",
                "com.docker.compose.version": "1.14.0"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "ee123f44b6fa390fd4647cce5902df741a313a3c7142d5f6e1de1c4eb46822f1",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "9000/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "9000"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/ee123f44b6fa",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "docker_default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "6801ad70cea4",
                        "php"
                    ],
                    "NetworkID": "d191fa31a761e4be554e67750ce2d9efd53d20ee2e8ddccf7e0fcfa64561c7e3",
                    "EndpointID": "3a2a4b7d2344b9aeafb0f9bfcc46987abb0e53b19b5e6c411f4f3b3f7096838f",
                    "Gateway": "172.19.0.1",
                    "IPAddress": "172.19.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:13:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]

In mouth section, i have

"Source": "/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io",

It's good path but, it's normal /C/ instead of C:/ ?

And the problem is still there. When i do a ls /var/www/symfony in my php container,
some folders/files are missing. Why ? Where is my mistake?

Thank you for your help

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

image

preview of my folder C:/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

image
And my ls result in my php container

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 21, 2017

My shared drive :

image

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 24, 2017

any idea ? Please :)

@SAMDevelopment

This comment has been minimized.

Copy link

commented Jul 25, 2017

For me running docker-compose down then clicking Apply again on the Shared Drives page followed by another docker-compose up solved the issue.

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jul 25, 2017

"Mounts": [
    {
        "Type": "bind",
        "Source": "/C/Users/admin/Documents/workspace/hedwige.io/api.hedwige.io/api.hedwige.io",
        "Destination": "/var/www/symfony",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
    }
],

At a glance, that looks okay; there are some possible pitfalls though (more below)

It's good path but, it's normal /C/ instead of C:/ ?

That's normal; the daemon is running in a Linux VM, so uses Linux paths (forward slash /). The Windows C: drive (if Volume sharing is enabled), is accessible both on /c/ and /C/ inside the Linux VM.

Now, there are some pitfalls;

While paths on the Windows host are case-insensitive, inside the Linux VM, they are not. So while you'd be able to browse both C:\Users\admin\workspace and C:\Users\admin\WorkSpace\ on your Windows machine, if the path doesn't match the actual path on the Windows host, the docker daemon will create a directory/path inside the VM with the exact case you specified.

As an example; if you specified -v C:\Users\admin\workspace:/var/www/symfony, but the actual name on the host was C:\Users\admin\Workspace (capital W), you'll end up with an empty directory inside the VM, and thus inside your container.

If volume sharing isn't working properly (there are a couple of possible causes listed in the troubleshooting section), the same applies; the docker daemon creates an empty directory inside the VM, and uses that.

What you're reporting looks like either volume sharing isn't working properly, or there's an issue with the path that's specified.

To narrow-down what's happening, start a simple container, and share your C:\ drive (without specifiying a specific directory);

docker run -it --rm -v C:\:/windows-drive/ busybox

The command above starts an interactive "busybox" container, and bind-mounts your entire C:\ drive into the /windows-drive/ directory inside the container.

Inside the container, go to the /windows-drive/ directory. If sharing is working properly, you should see all your files on your C-drive, so you should be able to navigate to your "workspace" directory, and projects inside. Try the Documents directory first, and see if the workspace directory shows up;

$ cd /windows-drive/Users/admin/Documents/
$ ls -la

If it does, and other directories, and files that are present in your C:\Users\admin\Documents\ directory as well, volume sharing should be working correctly; go from there, and see if the files/directories inside your workspace directory are there, and so on.

If the Documents directory does not contain the files you'd expect to see, volume sharing isn't working properly.

  • try disabling volume sharing, applying changes, and re-enable it
  • try restarting Docker
  • etc.

As you can see, there's many possible reasons for the problem you're describing, and it's hard to debug "remotely", without being "hands-on" on your machine, but hopefully the above helps.

@MikhaelGerbet

This comment has been minimized.

Copy link
Author

commented Jul 25, 2017

It's the sharing apply the problem !

@SAMDevelopment @thaJeztah thank you ! You are awesome ! 1000 thank's it works !!!!!

@aravindrangoju

This comment has been minimized.

Copy link

commented Oct 10, 2017

  1. Check whether the directories are shared in docker settings.
  2. If yes, goto Hyper V manager > MobyLinuxVM settings > management services > Integration services > check "Data exchange" and "Guest services"
@patrick-mota

This comment has been minimized.

Copy link

commented Oct 12, 2017

@SAMDevelopment Thank you ! I did the sharing only first and it doesn't work so I had to do like you said, docker-compose down, untick my shared drive, apply, check again, apply then docker-compose up and it works :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.