Docker Community Forums

Share and learn in the Docker community.

[Win 7 - docker-toolbox 1.9.1] Host mounts show up empty in container

(Philip Rodrigues) #1

Using docker-toolbox I want to mount the maven repository of my host in my jenkins container to alleviate loading.

What I expect: Having the host maven repository at //d/apps/maven/repository (Which is mounted in the docker-machine by docker toolbox): result of df -h in the docker-machine:
Filesystem Size Used Avail Use% Mou
C: 239G 186G 54G 78% /c
D: 466G 75G 391G 17% /d

(D is a local drive)

What i see, the /var/jenkins_home/.m2/repository folder is empty though the jenkins user has read and execute access.

Creating a datacontainer for a jenkins container:
docker run -v //d/apps/maven/repository://var/jenkins_home/.m2/repository -v //var/jenkins_home/jobs -v //var/jenkins_home/plugins --name data_jenkins busybox

And then mounting the data container to the jenkins container:

docker run -d --volumes-from data_jenkins --name my_jenkins -p 28080:8080 jenkins

Jenkins is reachable on as expected, but the maven repo folder (/var/jenkins_home/.m2/repository) is empty.
Can somebody point out the error in my ways here?

OS : Windows 7 enterprise
Docker-toolbox: 1.9.1
Virtualbox 5.0.10 (Not the one included in docker-toolbox)

Cheers! Philip

(Philip Rodrigues) #2

Ah, found out that the console of the docker-toolbox is actually not showing the docker-machine but the windows machine. Means that I have to mount the folder into the vm first and then map it to the container.