Development/Docker
[Docker] Container 에서 Jupyter Notebook 실행 시 비밀번호 설정
성딱이
2021. 12. 27. 18:32
반응형
Docker Container 내부에서 Jupyter Notebook을 실행 시 비밀번호를 설정하는 방법은 두 가지가 있다.
1) Dockerfile을 통해서 Docker Image를 만들 때, 미리 설정해주는 방법
2) Container 실행 후 Shell 명령어로 바꾸는 방법
레스기릿-
1. Build 단계에서 설정
# Dockerfile 내용 중
RUN jupyter notebook --generate-config
RUN echo '\
from IPython.lib import passwd \n\
password = passwd("입력할 비밀번호") \n\
c.NotebookApp.password = password' >> /root/.jupyter/jupyter_notebook_config.py
2. jupyter notebook 설정에서 변경
$ jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
출처 : https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
Running a notebook server — Jupyter Notebook 6.4.6 documentation
Content-Security-Policy (CSP) Certain security guidelines recommend that servers use a Content-Security-Policy (CSP) header to prevent cross-site scripting vulnerabilities, specifically limiting to default-src: https: when possible. This directive causes t
jupyter-notebook.readthedocs.io
반응형