I am new to docker. My host OS is W10 Enterprise 64bit, I installed docker v18.06.
I sucessfully installed docker in that I could pull and run hello world. I could pull the image I was interested in (miykael/nipype_tutorial), but on trying to run the image, the URL I am given does not work in my browser (firefox). I have tried replacing the front of the URL with localhost, host machine i/p and the DockerNAT i/p (I thought this would be the right one), but with no luck. Any ideas what is going wrong here?
See my powershell command and o/p:
PS C:\Users\MCLEAJO685> docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook
[I 09:50:53.936 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 09:50:53.956 NotebookApp] Writing notebook server cookie secret to /home/neuro/.local/share/jupyter/runtime/notebook_cookie_secret
[I 09:50:54.166 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.0
[I 09:50:54.198 NotebookApp] JupyterLab extension loaded from /opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/jupyterlab
[I 09:50:54.198 NotebookApp] JupyterLab application directory is /opt/miniconda-latest/envs/neuro/share/jupyter/lab
[I 09:50:54.348 NotebookApp] [nb_conda] enabled
[I 09:50:54.349 NotebookApp] Serving notebooks from local directory: /home/neuro/nipype_tutorial
[I 09:50:54.350 NotebookApp] The Jupyter Notebook is running at:
[I 09:50:54.351 NotebookApp] http://(815a6c95e372 or 127.0.0.1):8888/?token=e013619cdebfe111d69c1952ede336dd7a688813cd05d3c0
[I 09:50:54.351 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 09:50:54.354 NotebookApp] No web browser found: could not locate runnable browser.
[C 09:50:54.354 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(815a6c95e372 or 127.0.0.1):8888/?token=e013619cdebfe111d69c1952ede336dd7a688813cd05d3c0
Thanks for the response. Been playing around with this. I’m happy it isn’t a docker issue, I can run the image and login via bash. My issue seems to be with launching the jupyter notebook from the docker. I can’t get past the jupyter token/password page on my browser (have tried firefox and chrome). Been looking at the jupyter notebook password config files, tried to configure password from within docker (using bash) but haven’t got this to work.
This is probably a silly suggestion, but to start could you copy paste (verbatim) the starting up of a new container, the message in the console, and then exactly what you are copy pasting into the browser? Notably, take note (haha I just said that…) that the url shown gives you an option for two different urls and won’t work copy pasted as is. E.g., the one above you would likely want:
Note that there is also a --ip variable to control.
Just for testing - could you try this command (from this repo)
I know for certain that one works. I need to jump internet connections but give me a few minutes and I’ll test out the one that is giving you trouble! It might be some customization to the container.
hey @John_McLean I just tested the command and I had no trouble with the container, notebook, or token. Can you please verify the command you are doing:
$ docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook
and then copy paste the output to the console:
$ docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook
Unable to find image 'miykael/nipype_tutorial:latest' locally
latest: Pulling from miykael/nipype_tutorial
55cbf04beb70: Already exists
41eb4533cb5c: Pull complete
ba7e05b6d115: Pull complete
95e967ce7bf8: Pull complete
3bf444e47680: Pull complete
a70e0e77f5f3: Pull complete
bc52bd2b04a7: Pull complete
afdd73f6a3dd: Pull complete
ab3c79aef658: Pull complete
34a173932170: Pull complete
a015afb33252: Pull complete
6f148b9962e3: Pull complete
1d292d93bbee: Pull complete
667893538b7c: Pull complete
abced878c60b: Pull complete
0b786fbc745d: Pull complete
7e4cfa17687c: Pull complete
5c97396849c9: Pull complete
6560d1bcafc6: Pull complete
2d6413800f5b: Pull complete
ac3686495cde: Pull complete
Digest: sha256:47b95501a67f115fd6ee6246c855cf15db0523908c8bf55f80e18db8b27b7986
Status: Downloaded newer image for miykael/nipype_tutorial:latest
[I 04:14:40.560 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 04:14:40.592 NotebookApp] Writing notebook server cookie secret to /home/neuro/.local/share/jupyter/runtime/notebook_cookie_secret
[I 04:14:41.293 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.0
[I 04:14:41.367 NotebookApp] JupyterLab extension loaded from /opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/jupyterlab
[I 04:14:41.368 NotebookApp] JupyterLab application directory is /opt/miniconda-latest/envs/neuro/share/jupyter/lab
[I 04:14:41.819 NotebookApp] [nb_conda] enabled
[I 04:14:41.820 NotebookApp] Serving notebooks from local directory: /home/neuro/nipype_tutorial
[I 04:14:41.820 NotebookApp] The Jupyter Notebook is running at:
[I 04:14:41.820 NotebookApp] http://(d95137a793a8 or 127.0.0.1):8888/?token=150acab2f0a5e4a1c5f971e8708592a2a1143855ea5690b5
[I 04:14:41.820 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 04:14:41.821 NotebookApp] No web browser found: could not locate runnable browser.
[C 04:14:41.821 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://(d95137a793a8 or 127.0.0.1):8888/?token=150acab2f0a5e4a1c5f971e8708592a2a1143855ea5690b5
[I 04:24:09.305 NotebookApp] 302 GET /?token=150acab2f0a5e4a1c5f971e8708592a2a1143855ea5690b5 (172.17.0.1) 1.27ms
and exactly the url you are copy pasting into the browser?
Sorry for the delay in getting back to you. Other things getting in the way. I did as you asked. See the powershell commands and output below.
Interestingly, I am now getting a different error message and am not being given the URL. I think this may be a result of me updating docker a day or two ago. I can’t explain that otherwise as commands were identical. New error looks to relate to proxy issues.
PS C:\Users\MCLEAJO685> docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
The Docker client contacted the Docker daemon.
The Docker daemon pulled the “hello-world” image from the Docker Hub.
(amd64)
The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
I was digging around on various forums looking into the new error i was receiving. I saw one post suggesting ‘experimental features’ from Docker settings > Daemon, should be turned off. In hope rather than expectation, I turned experimental features ‘on’, as my setting was already off. Miraculously, this allows me to run the image and jupyter notebook. No idea why.
The url i had to copy onto my browser went as follows:
http://(572887568e37 or 127.0.0.1):8888/?token=a069361e348d97b30b42db38dcaa725b0ff1ff3cf9b21a68
where I edited it in the browser and selected the 127.0.0.1 i/p
Webbrowser is part of the python standard library, you don’t have to install a separate package to use it because it comes bundled with your python installation. If you want to get recognized browsers on your system:
import webbrowser
print webbrowser._browsers
If you directly use webbrowser.open() - it will always open the link in the default browser. What you can do is to register the any other browser and then launch a new tab. Something like this:
Once a python browser type is registered, the get() function can return a controller for that browser type. You can run open, open_new and open_new_tab on the controller object. This will ensure the commands are executed on the same browser instance you opened.