` # Add the package repositories distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker ` `docker pull nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04` `docker run --gpus all -it -d -v /home/sysang/workspace/AI-Lab:/workspace \ -p 8888:8888 -p 6006:6006 -p 8000:8000 -p 3000:3000 -p 3333:3333 -p 9000:9000 -p 9001:9001 -p 27018:27018 -p 5005:5005 \ sysang/cuda-jupyter-ubuntu18.04:1.0.1` log to container: `apt install wget` `apt install neovim` `apt install python3.7` `update-alternatives --install /usr/bin/python python /usr/bin/python3.7 10` `apt-get install python3-distutils` `wget https://bootstrap.pypa.io/get-pip.py` `python get-pip.py` `pip install --user jupyter` `jupyter notebook --generate-config` `edit /root/.bashrc, add` > `export PATH="/root/.local/bin:$PATH"` > `export LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH"` `edit "/root/.jupyter/jupyter_notebook_config.py"` > c.NotebookApp.allow_origin = '*' > c.NotebookApp.allow_remote_access = True > c.NotebookApp.allow_root = True > c.NotebookApp.base_url = '/' > c.NotebookApp.ip = '0.0.0.0' > c.NotebookApp.open_browser = False > c.NotebookApp.password = 'sha1:d0701cae494c:424284df7c9e7861ba218afd35193980986e886d' => pass is 111 > c.NotebookApp.port = 8888 > c.ContentsManager.root_dir = '/workspace' In host system, create script to start container ``` docker start ${jup_cont_id} docker exec -it -d ${jup_cont_id} bash -c "n/root/.local/bin/jupyter notebook" ```