Search code examples
jenkinsdockervolumedocker-toolbox

Docker doesn't save data in host mounted volume


I'm trying to start jenkins in a docker container using Docker Toolbox on Windows 7.

I run

docker run --name jenkins -p 8080:8080 -p 50000:50000 -v "//C/Users/myname/.jenkins:/var/jenkins_home" jenkins  

The jenkins starts up nicely, however there is nothing created under C:/Users/myname/.jenkins. I've created the folder but it stays empty.

When I now stop and remove the container and start it again, jenkins has lost everything I've done before.

What am I doing wrong?


Solution

  • I didn't manage to do this using the docker console, however it is possible using Kitematic in the Docker Toolbock. In the volumes tab, you can add local folders as volumes into the container. The Jenkins files appeared in the local folder as expected.