简体   繁体   中英

Starting jupyter lab on mounted drive with tensorflow docker image

On the official Tensorflow website documentation TF , it details how to install the latest nvidia and tensorflow Docker images. I then mounted my host directory and launch jupyter notebook by:

$ docker run -it --rm \
-p 8888:8888
--runtime=nvidia -v ~/my_dir:/container_dir \
tensorflow/tensorflow:lastest-gpu-py3

This command will start a jupyter notebook from the \\notebook directory in the container by default.

My questions are:

  1. How do I launch a jupyter notebook from mounted host directory, which contains my own notebooks? I realize I could just launch a bash shell from the docker image, cd to the mounted host directory, and start a notebook from there, but launching a notebook from root may not be a best practice.
  2. How do I launch jupyter LAB instead of jupyter NOTEBOOK, as I believe both their ports are 8888, and this TF image seems to launch a notebook by default.

You could write your own dockerfile which installs all dependencies and is based the tensorflow image. You could for example alter the run command that it changes the directory. Or you create a different image which installs Jupyter hub and starts the Instance on run. You can find a nice explanation on how to create dockerfiles here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM