Linux

Ubuntu Docker 설치 방법

보노남편 2022. 4. 4. 22:35

권장 OS

  • Ubuntu Impish 21.10
  • Ubuntu Hirsute 21.04
  • Ubuntu Focal 20.04 (LTS)
  • Ubuntu Bionic 18.04 (LTS)

 

설치 방법

1. 필요 패키지 설치

$ sudo apt-get update

$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

 

2. Docker GPG Key 추가

 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

 

3. Docker Repository 추가

$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

4. Docker 설치

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

 

5. 설치된 Docker 버전 확인

$ sudo docker -v

2022-04-04 기준 최신버전인 20.10.14 (2022-03-23) 버전이 잘 설치 되었다.

Way to check docker version

 

https://docs.docker.com/engine/release-notes/

 

Docker Engine release notes

 

docs.docker.com

 

6. 테스트

$ sudo docker run hello-world

아래와 같이 메세지가 출력되면 성공

Run hello-world from docker

 

출처 : https://docs.docker.com/engine/install/ubuntu/