develop

docker for window 설치 에러 해결

reko_ 2023. 1. 18. 23:34

docker가 wsl2 에서의 가동을 지원하면서 윈도우에서 초기 세팅이 어지러워짐

 

wsl2 - 리눅스 시스템을 윈도우 상에서 사용할 수 있게 해주는 서비스인데, 비교적 최근에 업데이트됨,

          1에서는 리눅스 환경을 구현해주는 서포트 프로그램을 사용했는데 2에서는 리눅스 커널을 윈도우 상에서 지원

 

 

1. wsl2 최신 패키지를 설치 

 

아래  두 명령어 실행

$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
//"Linux용 Windows 하위 시스템" 옵션 기능을 사용하도록 설정 - Windows에서 Linux 배포를 위함
$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
// Virtual Machine 플랫폼 옵션 기능을 사용하도록 설정 - wsl2 설치를 위함

 

 

윈도우 재부팅 후

x64 머신용 최신 WSL2 Linux 커널 업데이트 패키지를 다운로드 받아 설치

 

새 Linux 배포를 설치할 때 WSL 2를 기본 버전으로 설정

wsl --set-default-version 2

 

2. Docker for window 설치

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

 

 

3. Docker 실행 후 wsl2 위에서 가동 확인

$  wsl -l -v
  NAME                   STATE           VERSION
* docker-desktop         Running         2
  docker-desktop-data    Running         2
$ docker version
Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 ...

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)

 

 

추가적으로,

 

 

무한 로딩 에러 발생시!!

도커 데몬이 윈도우 버젼으로 실행되고 있지 않기 때문이다. -  (도커 데몬이란? https://hanseom.tistory.com/250)

도커 프로그램 파일에서 cli로 swichDaemon이란 명령어 실행하기

 
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

 

에러(docker error) in the default daemon configuration on windows the docker client must be run elevated to connect 발생시!!

Expose deamon on tcp://localhost:2375 without TLS 옵션키기

(아래 Use the WSL 2 based engine 은 wsl2를 사용하기 때문에 켜져있어야 한다.)