[Spring] Windows11에서 Doker 설치하기
Windows11에서 Doker 설치하기
[1] Windows Terminal 설치
- Microsoft Store > Windows Terminal 다운로드 Microsoft 공식 홈페이지
[2] WSL2 설치
‘Windows Terminal’ 앱을 관리자 권한으로 실행 (다음 명령어 실행)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
[3] Virtual Machine 기능 사용
- ‘Windows Terminal’ 앱을 관리자 권한으로 실행 (다음 명령어 실행)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
[4] WSL2 업그레이드
Linux커널 업데이트 패키지 최신 다운로드
패키지를 정기적으로 업데이트하고 업그레이드하는 것이 좋다
sudo apt update && sudo apt upgrade
case | powershell |
---|---|
기본 WSL 버전 설정 | wsl –set-default-version 2 |
배포판 WSL 버전 변경 | wsl –set-version |
예시 | wsl –set-version Ubuntu-18.04 2 |
[5] GNU/Linux 앱 설치
- 새로 설치된 Linux 배포를 처음 시작 > 콘솔 창이 열림 > 파일이 압축 해제
- Enter new UNIX username: ubuntu(EC2 환경과 동일하게 설정한다)
- New password:
- Retype new password:
- 화면에 보이지 않으므로 인지하면서 입력한다!
ubuntu@DESKTOP-UFPCV7J:~$
로 접속되는 것 확인
[6] Doker Desktop 설치
- 다운받은 ‘Docker Desktop Installer’ 실행
Update to the latest version of WSL 2 from Microsoft (Recommended - requires administrator password) We run `wsl --update` for you.
[7] 도커 WSL 설정 확인하기
- Settings > Resources > WSL INTEGRATION 선택 후 > 설정 확인 > Apply & Restart
- Enable Integration with my default WSL distro
- Enable Integration with additional distros: “설치한 리눅스 배포판”
[8] 설치 확인
‘Ubuntu’에서 다음 명령어 실행하여 설치 확인
docker run -d -p 80:80 docker/getting-started
docker ps
docker images
참고 레퍼런스
MS 공식 페이지의 1~6단계
WSL의 수동 설치 단계WSL 2에서 Docker 원격 컨테이너 시작
WSL 2에서 Docker 원격 컨테이너 시작
This post is licensed under CC BY 4.0 by the author.