从https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#notebook-options看来,我们可以使用:
启动具有指定密码的容器docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.password='sha1:74ba40f8a388:c913541b7ee99d15d5ed31d4226bf7838f83a50e'
我知道这里的密码是加密的,sha1的值是[sha1:74ba40f8a388:c913541b7ee99d15d5ed31d4226bf7838f83a50e]
要根据https://jupyter-notebook.readthedocs.io/en/stable/public_server.html加密我自己的密码,我们可以使用以下命令生成这样的密码:
In [1]: from notebook.auth import passwd
In [2]: passwd()
我尝试使用密码“ password”:
$ from notebook.auth import passwd
$ passwd("password")
'sha1:4259764db923:8f6a9501a8ba217c9f1616210991f412bafdcebd'
,然后尝试启动我的容器:
docker run -d -p 11000:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.password='sha1:4259764db923:8f6a9501a8ba217c9f1616210991f412bafdcebd'
然后...有效! 是的..有时您通过解释问题找到答案;)