[Docker] Ubuntu Docker, Docker Compose 설치

JohnnySeo·2022년 11월 15일
0

Ubuntu 기반 리눅스에 Docker 및 Docker Compose 를 설치하는 방법.

1. 저장소 설정

  1. apt 업데이트 - HTTPS를 통해 리포지토리를 이용가능하도록 패키지 index를 업데이트하고 설치한다.
 $ sudo apt-get update
 $ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
  1. Docker 의 공식 GPG키 추가.
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  1. 리포지토리 설정
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

2. 도커 엔진 설치

  1. apt 패키지 index 업데이트
$ sudo apt-get update
  1. 도커엔진, 컨테이너 및 Docker Compose 설치
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
  1. 설치 확인
 $ sudo docker run hello-world

설치가 정상적으로 진행 되었다면,
아래와 같은 메세지가 출력된다.

*참고

profile
안녕하세요.

0개의 댓글