관리 메뉴

NineTwo meet you

Ubuntu 20.04 - Docker 설치 본문

기타

Ubuntu 20.04 - Docker 설치

NineTwo 2022. 5. 30. 23:52
반응형

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

 

Install Docker Engine on Ubuntu

 

docs.docker.com

공식문서를 참고해 Ubuntu위에 Docker Engine을 설치합니다.


1. Docker 완전 삭제

$ sudo apt-get remove docker docker-engine docker.io containerd runc

2. Setting Repository

도커 repository 환경을 구성하기 위해 기존 패키지들을 업그레이드 하고 필요한 패키지를 다운받는다.

$ sudo apt-get update
$ sudo apt-get -y install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

3. Register Docker's  Official GPG Key

 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$  echo \
  "deb [arch=amd64 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. Install Docker Engine

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

5. Check Docker version

$ docker --version
$ sudo docker run hello-world

6. Install Docker Compose

 $ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 $ sudo chmod +x /usr/local/bin/docker-compose

7. Check Docker version

$ docker-compose --version
반응형
Comments