Jupyter notebook Image Pull
- https://hub.docker.com/r/jupyter/datascience-notebook/
- docker pull jupyter/datascience-notebook
Docker
hub.docker.com
Docker Container 생성 (Jupyter Notebook)
docker run \
--name jupyter-notebook \
-e GRANT_SUDO=yes \
--user root \
-p 8800:8888 \
-d \
-it \
jupyter/datascience-notebook
- --name : 컨테이너 이름
- -e : jupyter notebook 에 root 권한 할당
- --user : 컨테이너에 root 권한 할당
- -p : 호스트 포트 번호 : 컨테이너 포트 번호
- -d : 백그라운드 실행
- -it : 컨테이너 생성 시, 명령어 실행
Docker Container 실행 (Jupyter notebook)
docker exec -it jupyter-notebook bash
Jupyter notebook 비밀번호 생성
ipython
>> from notebook.auth import passwd
>> passwd()
>> 비밀번호 입력
>> 비밀번호 재입력
## 출력된 비밀번호 토큰을 따로 저장해둔다. (추 후 사용)
>> exit
Jupyter notebook 비밀번호 설정
sudo apt-get update
sudo apt-get install vim -y
sudo vim ~/.jupyter/notebook_config.py
c.NotebookApp.password_required = True
c.NotebookApp.password = '' # 위에서 생성한 비밀번호 토큰을 입력
exit
Docker Container(Jupyter notebook) 재실행
docker restart jupyter-notebook
Jupyter notebook 웹 접속 후, 비밀번호 입력
서버IP주소:포트번호
'Tools > Docker' 카테고리의 다른 글
[Docker] Error response from daemon 해결 (1) | 2022.09.30 |
---|---|
[Docker] 도커 설명 (2) | 2022.09.29 |
댓글