I’m running docker within a container using the command below:
docker run --rm -ti --privileged -v /var/run/docker.sock:/var/run/docker.sock docker:1.12 sh
Within that container’s shell I see a directory with a bunch of files. Let’s say
/project with a file
build.gradle. I’d like to start a new container and mount this directory using the command below
docker run -ti --rm -v /project:/project openjdk:8-jdk bash -c "ls /project".
However it looks like the project directory is empty, the
ls /project does not show any files…
Now trying to mount a file:
docker run -ti --rm -v /project/build.gradle:/project/build.gradle openjdk:8-jdk bash -c "ls /project/"
This time the folder shows the file.
Anyone who has an idea why the volume mount does not work as expected. Is this a permission issue?