I run Jupyter Notebook with Docker and trying to mount local directory onto the intended Docker volume. But I am unable to see my files in the Jupyter notebook. The Docker command is
sudo nvidia-docker create -v ~/tf/src -it -p 8888:8888
-e PASSWORD=password
--name container_name gcr.io/tensorflow/tensorflow:latest-gpu
and the GUI of the Jupyter Notebook looks like
but ~/tf/src
are not shown up in the Jupyter GUI.
What are needed for the files to shown up in the Jupyter? Am I initializing the container incorrectly for this?
the way you mount your volume i think its incorrect
-v ~/tf/src
it should be-v /host/directory:/container/directory
Karl L thinks the solution is the following below. The solution moved here for everyone to judge it and make the question easier to read.
Solution
As @fendi-d pointed out I was mounting my volume incorrectly.
Then I was pointed to the incorrect mounting dir and I found the correct one in the tensorflow docker file https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.gpu
Which configures the jupyter notebook and then copies files to "/notebooks"
After I ran with the correct mounting path it showed my files located in "/Users/user/tf/src"
Ferdi D's answer targets only files inside interpreter, not precisely files inside Jupyter GUI, which makes things a little bit confusing. I target the title
Show volume files in docker jupyter notebook
by more generally showing the filse inside Jupyter notebook.Files inside the interpreters
The
-v
flag gets you the files in the interpreter or the notebook but not necessarily in the Jupyter GUIfor which you run
because the mount point depends on a distribution and hence its path. Here, you ask your current directory to be mounted to Jupyter's path
/home/jovyan
.Files inside Jupyter GUIs
Further threads