Docker Community Forums

Share and learn in the Docker community.

Unable to access host directory / volume


(Damien Nozay) #1

Expected behavior

directory is mounted and container is able to share & persist files on the host.

Actual behavior

share-nothing model.

Information

  • the output of:
    • Moby Menu > Diagnose & Feedback on OSX
Docker for Mac: version: mac-v1.11.2-beta15
OS X: version 10.10.5 (build: 14F1808)
logs: /tmp/20160617-082457.tar.gz
failure: No error was detected
[OK]     docker-cli
[OK]     app
[OK]     menubar
[OK]     virtualization
[OK]     system
[OK]     osxfs
[OK]     db
[OK]     slirp
[OK]     moby-console
[OK]     logs
[OK]     vmnetd
[OK]     env
[OK]     moby
[OK]     driver.amd64-linux
  • a reproducible case if this is a bug, Dockerfiles FTW
  • page URL if this is a docs issue or the name of a man page

Not a doc issue, but I used this page as a reference.
https://docs.docker.com/engine/userguide/containers/dockervolumes/#mount-a-host-directory-as-a-data-volume

  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

OS X: version 10.10.5 (build: 14F1808)

Steps to reproduce the behavior

  1. Clone https://github.com/dnozay/docker-centos-openldap
  2. run make
  3. docker build will fail due to file missing (not shared with host).

docker inspect test:

        "Mounts": [
            {
                "Name": "91288d56ad065a180f324397ed4ada7d552e02c8aaf6c84d56419da46e6b6c4a",
                "Source": "/var/lib/docker/volumes/91288d56ad065a180f324397ed4ada7d552e02c8aaf6c84d56419da46e6b6c4a/_data",
                "Destination": "/var/lib/ldap",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            },
            {
                "Name": "9df59cff8989712a449d42ab78822117fae19ac53cae2318884a8041c532b302",
                "Source": "/var/lib/docker/volumes/9df59cff8989712a449d42ab78822117fae19ac53cae2318884a8041c532b302/_data",
                "Destination": "/etc/openldap",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
...
            "Cmd": [
                "-v",
                "/Users/dnozay/WORK/dockerfiles/centos-slapd/etc/openldap:/etc/openldap",
                "-v",
                "/Users/dnozay/WORK/dockerfiles/centos-slapd/var/lib/ldap:/var/lib/ldap",
                "-p",
                "389:389",
                "/bin/bash"
            ],
...
            "Volumes": {
                "/etc/openldap": {},
                "/var/lib/ldap": {}
            },