title: Jupyter password and Docker
body: <p>For changing / setting the password of a Jupyter server, I follow the instructions here:</p>
  
  <p><a href="http://jupyter-notebook.readthedocs.io/en/latest/public_server.html#preparing-a-hashed-password" rel="noreferrer">http://jupyter-notebook.readthedocs.io/en/latest/public_server.html#preparing-a-hashed-password</a></p>
  
  <p>I do this in my local ipython environment. One thing to note is that somehow I get different hashes every time I re-run the <code>passwd()</code> command for the same password, but I assume that's intended behavior.</p>
  
  <p>Anyway. I get the hash, and then I have a line like this in a Dockerfile:</p>
  
  <p><code>ENV PW_HASH="u'sha1:salt:hash'"</code></p>
  
  <p>and in the start-up script for the jupyter notebook I have</p>
  
  <p><code>echo "c.NotebookApp.password = ${PW_HASH}" &gt;&gt; ${CONFIG_PATH}</code></p>
  
  <p>and then
  <code>jupyter notebook --allow-root -y --no-browser --ip=0.0.0.0 --config=${CONFIG_PATH}</code></p>
  
  <p>However, if I then run the docker container via</p>
  
  <p><code>docker run -it -p 8888:8888 &lt;container-name&gt;</code></p>
  
  <p>while it does start up jupyter and allows me to connect in my browser via <code>localhost:8888</code>, it won't accept the password I just set via its hash.</p>
  
  <p>Strangely, it does work when I add the additional step of the SSL certificates (and go to <a href="https://localhost:8888" rel="noreferrer">https://localhost:8888</a>). What's going on here?</p>
  
  <p>PS: I know that having a password but no SSL is sketchy. I'm just testing it out step by step and wonder why it won't work without the SSL part.</p>