Skip to content

Instantly share code, notes, and snippets.

@yasushisakai
Last active November 18, 2019 21:18
Show Gist options
  • Save yasushisakai/5292dcf4559c61229cd5e413d09f68be to your computer and use it in GitHub Desktop.
Save yasushisakai/5292dcf4559c61229cd5e413d09f68be to your computer and use it in GitHub Desktop.
commands to start tensorflowing

ssh-ing with Tunneling

if using jupyter notebook, ssh tunnel so you can use your local browser

ssh -L 8888:localhost:8888 guest@IP.ADD.RE.SS

once shelled in, most of the containers are already setup

Run docker containers

choose what you want

# just gpu
docker run --gpus all -it tensorflow/tensorflow:latest-gpu bash

# w/ python3
docker run --gpus all -it tensorflow/tensorflow:latest-gpu-py3 bash

# w/ jupyter notebook
docker run --gpus all -it -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3-jupyter
# jupyer will let you know which endpoint to visit

Mount local directory to container

# assuming you have a folder at ~/code with scripts insde
docker run --gpus all -it --rm -v $HOME/code:/code tensorflow/tensorflow:latest-gpu bash
# stuff inside code will be accessible
@yasushisakai
Copy link
Author

memo: was able to use the tunneling technique for postgres container too.

docker run -p 5432:5432 --name Postgres -e POSTGRES_PASSWORD=SECRET_PASSWORD -d postgres

by tunnel ssh-ing (ssh -L 5432:localhost:5432 in this case) you will be able to access to the db as if there was one locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment