OS/Linux

WSL 기반 Docker설치(Ubuntu 20.04 LTS Server 버전)

아르비스 2021. 10. 1. 11:46

■ Windows 10기반 WSL 설치

https://sncap.tistory.com/1012

 

1. Ubuntu Update

apt update & apt upgrade

 

2. Docker 설치하기

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

 

 

3. GPG Key 인증

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

※ Error 처리

SSL certificate verify result: EE certificate key too weak (66)
curl: (60) SSL certificate problem: EE certificate key too weak

 

원인: openssl 버전이 1.1.1c 이상으로 올라가면서 key size 2048비트 이상의 (CA) 인증서 필요

root@DESKTOP-Juseok:/mnt/c/Users/sncap# openssl version
OpenSSL 1.1.1f  31 Mar 2020
root@DESKTOP-Juseok:/mnt/c/Users/sncap#

 

조치방법

  1. 검증을 하지 않는 옵션인 -k(--insecure) 옵션을 주고 curl 을 구동
    curl -k -L docker.com curl -fsSL -k -L https://download.docker.com/linux/ubuntu/gpg | apt-key add -
     

키 확인

$ apt-key fingerprint 0EBFCD88

 

 

예외처리

docker가 실행이 안되는 경우

# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Docker version 확인(설치 여부 확인)

# docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

docker가 정상적으로 실행이 안된 상태로 Docker 실행

# sudo /etc/init.d/docker start
 * Starting Docker: docker                                                                                       [ OK ]

 

다시 Docker version 확인

# docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:42 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0