Post

[Spring] Windows11에서 Doker 설치하기

Windows11에서 Doker 설치하기

[1] Windows Terminal 설치

[2] WSL2 설치

  • ‘Windows Terminal’ 앱을 관리자 권한으로 실행 (다음 명령어 실행)
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    스크린샷 2024-01-30 163847

  • WSL2 요구사항 확인 (다음 명령어 실행)
    winver
    스크린샷 2024-01-30 164023

[3] Virtual Machine 기능 사용

  • ‘Windows Terminal’ 앱을 관리자 권한으로 실행 (다음 명령어 실행) dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

[4] WSL2 업그레이드

  • Linux커널 업데이트 패키지 최신 다운로드
    image

  • 패키지를 정기적으로 업데이트하고 업그레이드하는 것이 좋다 sudo apt update && sudo apt upgrade

casepowershell
기본 WSL 버전 설정wsl –set-default-version 2
배포판 WSL 버전 변경wsl –set-version
예시wsl –set-version Ubuntu-18.04 2

[5] GNU/Linux 앱 설치

  • Microsoft Store > Ubuntu LTS 다운로드
    image

  • 새로 설치된 Linux 배포를 처음 시작 > 콘솔 창이 열림 > 파일이 압축 해제
  • PC에 저장될 때까지 1~2분 정도 소요 > 새 Linux 배포를 위한 사용자 계정 및 암호 생성
    image

  • Enter new UNIX username: ubuntu(EC2 환경과 동일하게 설정한다)
  • New password:
  • Retype new password:
  • 화면에 보이지 않으므로 인지하면서 입력한다!
    image

ubuntu@DESKTOP-UFPCV7J:~$로 접속되는 것 확인

[6] Doker Desktop 설치

Doker 설치 홈페이지

  • 다운받은 ‘Docker Desktop Installer’ 실행 스크린샷 2024-01-30 171645
  • Configuration 항목은 모두 체크 스크린샷 2024-01-30 171703

  • Docker를 실행한 뒤, 약관을 확인 > 동의
    image

  • Update to the latest version of WSL 2 from Microsoft (Recommended - requires administrator password) We run `wsl --update` for you.

image

[7] 도커 WSL 설정 확인하기

  • Settings > General 선택 후 > 설정 확인
    image

  • Settings > Resources > WSL INTEGRATION 선택 후 > 설정 확인 > Apply & Restart
  • Enable Integration with my default WSL distro
  • Enable Integration with additional distros: “설치한 리눅스 배포판” image

[8] 설치 확인

  • ‘Windows Terminal’ 관리자 권한으로 실행(wsl -l -v 명령어 실행)
    image

  • ‘Ubuntu’에서 다음 명령어 실행하여 설치 확인
    docker run -d -p 80:80 docker/getting-started
    docker ps
    docker images

참고 레퍼런스

This post is licensed under CC BY 4.0 by the author.