Monday, 25 December 2017

python - Google Earth Engine API: localhost refused to connect


I'm trying to implement this https://github.com/samsammurphy/gee-atmcorr-S2 in Google Earth Engine using Docker Toolbox for atmospheric correction.


I first install Datalab following the instruction on https://developers.google.com/earth-engine/python_install-datalab-local


Once that's done, it show me the path guope@DESKTOP-RST8AAG MINGW64 ~/workspace/datalab-ee


Then I pull the docker image using docker pull samsammurphy/ee-python3-jupyter-atmcorr:latest



Then I run docker run -i -t -p 8888:8888 samsammurphy/ee-python3-jupyter-atmcorr and it shows me root@5d7195f4dd85:/#, which means I'm in a virtual OS.


Then I authenticate my EE account and it shows Successfully saved authorization token.


Then I grab the source code git clone https://github.com/samsammurphy/gee-atmcorr-S2 and navigate to the folder cd gee-atmcorr-S2/jupyer_notebooks/.


However, when I copy/paste the URL into my browser, it says localhost refused to connect. Ideally, I think it should open the jupyter notebook with the script loaded.


Can anyone please tell me what the problem is and how to fix it?


root@88676ad61bbb:/gee-atmcorr-S2/jupyer_notebooks# jupyter-notebook sentinel2_atmospheric_correction.ipynb --ip='*' --port=8888 --allow-root
[W 10:25:15.109 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 10:25:15.128 NotebookApp] Serving notebooks from local directory: /gee-atmcorr-S2/jupyer_notebooks[I 10:25:15.129 NotebookApp] 0 active kernels
[I 10:25:15.129 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=...
[I 10:25:15.129 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[W 10:25:15.130 NotebookApp] No web browser found: could not locate runnable browser.
[C 10:25:15.131 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=...

Also noticed that the error No web browser found: could not locate runnable browser.



Answer



It turns out I should use my IP address: http://192.168.99.100:8888/?token=....



Reference: https://www.reddit.com/r/docker/comments/a4gvnm/localhost_refused_to_connect/?utm_content=full_comments&utm_medium=message&utm_source=reddit&utm_name=frontpage


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...