Infra/Docker

Docker로 Jupyter Lab 실행

wave35 2023. 3. 25. 21:26

 

[ Windows에 Docker설치 ]

 

# Power Shell을 관리자권한으로 연 후, 명령어

$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

 

#x64 머신용 최신 WSL2 Linux 커널 업데이트 패키지 설치 

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

 

#버전 설정

$ wsl --set-default-version 2

 

#아래 URL에서 Windows용 Docker설치

https://www.docker.com/products/docker-desktop

 

#확인

$ docker version

$ docker ps

 

참조 : 

https://www.lainyzine.com/ko/article/a-complete-guide-to-how-to-install-docker-desktop-on-windows-10/

 

 

 

[ docker ps 명령어 에러시 ]

 

error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect

 

#해당 윈도우에서 가상컴퓨터를 만들 수 있도록 설절

PowerShell에서 

$ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

 

참조 : https://docs.microsoft.com/ko-kr/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v

 

 

 

[ WSL2에 우분투 설치 ]

 

https://www.44bits.io/ko/post/wsl2-install-and-basic-usage

 

 

 

[ Jupyter Lab 실행 ]

 

#설치 및 실행

$ docker create -p 8888:8888 --user root -e GRANT_SUDO=yes --name awsanalytics jupyter/minimal-notebook

$ docker start awsanalytics 

$ docker logs awsanayltics 

... 토큰 값 확인 후 로그인시 사용..

 

# 웹페이지에서 확인

http://127.0.0.1:8888 주소로 접속해 아래와 같은 화면 확인

 

# Windows용 Docker에서도 실행 및 CLI확인

 

# aws 사용위한 패키지 설치 [ jupyter terminal ]

$ pip install awscli

$ sudo apt update

$ sudo apt install groff -y

$ sudo apt install less -y