Add third option: Route container to another local port (#1872)

* Add third option: Route container to another local port

Jupyter can have multiple local instances if the used ports don't overlap. Added this as a troubleshooting alternative for users who may want or need to have more than one Jupyter instance running.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update troubleshooting.md

* Update troubleshooting.md

* Update troubleshooting.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
Donovin Emerson
2023-02-10 10:53:59 -06:00
committed by GitHub
parent 7ea428dfd0
commit 299ce93e86

View File

@@ -310,3 +310,19 @@ If you are a regular user of VSCode and the Jupyter extension, you might experie
You can achieve this from the `Preferences > Jupyter` menu in VScode:
![VSCode Preferences UI - Jupyter: Disable Jupyter Auto Start checkbox unchecked](../_static/using/troubleshooting/vscode-jupyter-settings.png)
3. **Route container to unused local port**
Instead of mapping Docker port `8888` to local port `8888`, map to another unused local port.
You can see an example of mapping to local port `8001`:
```bash
docker run -it --rm -p 8001:8888 jupyter/datascience-notebook
```
When the terminal provides the link to access Jupyter: <http://127.0.0.1:8888/lab?token=80d45d241a1ba4c2...>,
change the default port value of `8888` in the url to the port value mapped with the `docker run` command.
In this example we use 8001, so the edited link would be: <http://127.0.0.1:8001/lab?token=80d45d241a1ba4c2...>.
Note: Port mapping for Jupyter has other applications outside of Docker. For example, it can be used to allow multiple Jupyter instances when using SSH to control cloud devices.