recently started using docker and tried to crate a container with jupyter lab, so it could run on a local host.
Since I have been using anaconda before it seems like that localhost:8888 is already taken, so I have tried to use another avaliable port. `docker run -p 8080:8080 <image_name>’ created a link which web page with token authentification which gives me no chance to enter. Also it used same port 8888. Is there any other port to use so that both, anaconda and docker work together without errors?
2
Answers
Have you tried this?
TL;DR:
Run docker as
Then, inside your container, initialize Jupyter with:
Now you are supposedly able to access the notebook through your desktop browser on http://localhost:8888
The
-p
option to docker run takes two ports. First is the port on the host that you want to connect to, and second is the port within the container that the service is running on.Assuming jupyter is running on port
8888
inside the container, and you want to access it on8080
on your localhost, the command you are looking for would be:or to run it interactively and clean up after itself: