docker image for pytorch and jupyter supporting GPU
191
This is a Dockerfile that Jupyter Notebook automatically builds Docker images.
This is a Dockerfile built on the pytorch/pytorch image.
Because the root is not open in the official image of jupyter, a series of operations that need to be installed with root privileges in the jupyter notebook are restricted, such as apt install.
Therefore, based on the official image of jupyter, I added additional root privileges, added support for zsh and oh-my-zsh, and commonly used plugins in jupyter notebook.
For more details,
Github: link
Docker: link
Run Jupyter Notebook by default.
docker run --gpus all --restart=always --name pytorch -ti --ipc=host -p "$PORT":8888 -v "$PWD":/workspace silvesterhsu/docker-pytorch:"$TAG"
$PORT: Port mapping. It is the port that needs to link the local to the image. In docker, jupyter will open port 8888 as a web access. If the local port 8888 is not occupied, it is recommended to use 8888.
$PWD: File mapping. Project work path
$TAG: For the time being, only latest, if not filled in, the latest version is downloaded by default. The ARM version may be available in the future.
Example:
docker run --gpus all --name pytorch --restart=always -ti --ipc=host -p 8888:8888 -v ~/new_project:/workspace silvesterhsu/docker-pytorch
Once you start container, an uniquetoken will be shown in the terminal.

Use the token to setup a password when you open the browser 127.0.0.1:8888.
note: The port number depends on the port you are mapping

Once the password is set and successfully logged in, jupyterLab completes the password configuration. You need to terminate and restart the lab container in the terminal.
Use control+C to stop the jupyterlab container, or start a new terminal:
docker restart pytorch
It is necessary to restart the container. After the password is stored, it needs to be restarted to apply.
Then, setting the password is complete.
Content type
Image
Digest
Size
2.4 GB
Last updated
over 6 years ago
docker pull silvesterhsu/docker-pytorch