When I use docker machine to open my Jupyter notebook, there is a strange issue happening. The website needs me to enter password so that I can get access to the notebook. It is really strange! Do you know why? Actually, I am using my docker machine to use tensorflow to learn machine learning. I use docker container and terminal to get tensorflow and try to open jupyter notebook on the browser. But it lets me to enter password to use notebook after the Jupyter appeared on my browser.
Run the following Docker run command in a command prompt to pull a Jupyter Docker Scipy-Notebook image and run its container. The Jupyter Docker Scipy-Notebook will run the Jupyter server and print the server URL in a console, click on that URL to open the JupyterLab application in the web browser.
it still asks for a password for security reasons, since users with access can run arbitrary Python code on the server machine! so if your browser is not opening automatically, you can try one of those links, which seem to have a login token on them, and then investigate why your browser is not opening automatically.
You can set access control for Jupyter notebooks at the account level and at the object level. This feature is available in the latest version of Jupyter Notebooks. If you are not using the latest version of Jupyter notebooks, you can enable this feature from the Control Panel >> Account Features page.
You can supply the password to Tensor Flows docker container through an environment variable called PASSWORD like this:docker run -it -p 8888:8888 -e "PASSWORD=abc123" gcr.io/tensorflow/tensorflow
Just add the -e parameter and specify you evironment variable after that.
If you look through the github repository for the docker image you can find this snippet at the bottom of jupyter_notebook_config.py
# sets a password if PASSWORD is set in the environment
if 'PASSWORD' in os.environ:
c.NotebookApp.password = passwd(os.environ['PASSWORD'])
del os.environ['PASSWORD']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With