IT's 2 EG

Ubuntu에 Docker 설치하기 본문

IT 및 보안/도커 & 쿠버네티스

Ubuntu에 Docker 설치하기

엠씨비기 2020. 10. 28. 12:52

1. OS 요구사항

Docker Engine을 설치하려면 아래 Ubuntu 버전 중 하나의 64비트 버전이 필요합니다.

 - Ubuntu Focal 20.04(LTS)

 - Ubuntu Bionic 18.04(LTS)

 - Ubuntu Xenial 16.04(LTS)

 

Docker Engine은 x86_64 (또는 amd64), armhf, arm64 아키텍처에서 지원됩니다.

('arch' 또는 'uname -m' 등의 명령어를 통해 아키텍처 확인이 가능)

2. 설치 방법

환경에 따라 다양한 방법으로 Deocker Engine을 설치할 수 있습니다.

대부분의 사용자들에게 쉬운 설치 및 업그레이드를 위한 가장 권장되는 방식은

Docker Repository를 설정하고 이곳에 Docker 엔진을 설치하는 것입니다.

2.1. Repository 설정

1) apt 패키지 업데이트 후 필수 패키지 설치

$ sudo apt-get update

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

2) Docker의 공식 GPG키 추가

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

3) Docker Repository 설정

※ 아키텍처 정보에 따라 아래 명령어를 통해 안정적인 Repository를 설정합니다.

 

[x86_64/amd64]

$ sudo add-apt-repository \
	"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

[armhf]

$ sudo add-apt-repository \
	"deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

[arm64]

$ sudo add-apt-repository \
	"deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

2.2. Docker Engine 설치

1) apt 패키지 업데이트 및 최신 Docker Engine 설치

$ sudo apt-get update

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

2) 정상 설치 확인

  - docker -v 명령어에 대한 버전 정보 정상 출력 확인

  - hello-world 이미지 정상 실행 확인

$ sudo docker -v

$ sudo docker run hello-world
Comments