Search code examples
dockerubuntutensorflownvidia-dockersharefile

How can I making the host directory sharable on Ubuntu?


I can't see the Jupyter files in /home/easton/notebooks, how can I fix this?

nvidia-docker run -it --rm --name tf -p 8888:8888 -p 6006:6006 -v /home/easton/notebooks:/notebooks tensorflow/tensorflow:1.14.0-gpu-py3-jupyter

Solution

  • You are mounting the wrong directory, according to documentation the correct path for TensorFlow is ~/notebooks/ or /tf/notebooks in the container.

    Docker run command will be

    nvidia-docker run -it --rm --name tf -p 8888:8888 -p 6006:6006 -v /home/easton/notebooks:/tf/notebooks tensorflow/tensorflow:latest-py3-jupyter
    

    You can check offical documentation and here

    Optional Features

    jupyter tags include Jupyter and some TensorFlow tutorial notebooks.. They start a Jupyter notebook server on boot. Mount a volume to /tf/notebooks to work on your own notebooks.

    docker run -it --rm -v $(realpath ~/notebooks):/tf/notebooks -p 8888:8888 tensorflow/tensorflow:latest-py3-jupyter

    Run a Jupyter notebook server with your own notebook directory (assumed here to be ~/notebooks). To use it, navigate to localhost:8888 in your browser.