Category:Study resources

Docker initialization
In order to open a new docker use the following command: nvidia-docker run -it --mount type=bind,source=/common_space/tensorflow/,target=/common_space_docker/ -p 7777:22 -p 6006:6006 -p 6007:6007 -p 6008:6008 -p 6009:6009 -p 6010:6010 -p 6011:6011 -p 6012:6012 -p 6013:6013 -p 6014:6014 -p 6015:6015 --name tensorflow gcr.io/tensorflow/tensorflow:latest-gpu-py3 bash Options:
 * bind maps a directory in the server to a directory in the docker. Hence in "source=XXXX" put a new directory for your docker. e.g. "/common_space/new_docker_env". The "target" attribute of mount should not be changed.
 * p maps ports of the server and the docker. For instance "-p 7777:22" maps the port 7777 of the server to port 22 of the docker.
 * name here choose the name of the new docker.

Arguments:
 * docker image path to docker image. e.g "gcr.io/tensorflow/tensorflow:latest-gpu-py3".
 * command to run in the new opened docker. e.g "bash".

Docker restart
In order to reopen a closed docker use the following command docker restart DOCKER_NAME Note that once the docker is restarted, the ssh-server activation should be done again

ssh-server activation
Initiate bash shell of the docker: docker exec -it DOCKER_NAME bash

Enable the ssh command, run the following command inside the docker container. apt update && apt install -y openssh-server mkdir /var/run/sshd echo 'root:123456' | chpasswd

The last command changes root password to 123456. sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd echo "export VISIBLE=now" >> /etc/profile service ssh restart

packages installation
pip install --upgrade pip pip install --upgrade tflearn pip install --upgrade matplotlib pip install torch torchvision

View existing docker containers
In order to view all existing docker containers run the following command: docker ps -a

Open a shell of a docker
In order to open a new shell of an existing docker, run this command in the server: docker exec -it DOCKER_NAME bash