[Docker] Ubuntu에 Docker 설치

𝒄𝒉𝒂𝒏𝒎𝒊𝒏·2023년 5월 17일
0
post-thumbnail




1. Ubuntu에 도커 설치하기

Ubuntu에 Docker를 설치하는 단계는 다음과 같습니다.
1. 필요한 항목 설치
2. Docker 저장소 활성화 및 저장소 GPG 키를 가져오기
3. 패키지 설치


## 1-1. 필요한 항목 설치 먼저 패키지 인덱스를 업데이트하고 새 HTTPS 리포지토리를 추가하는 데 필요한 종속성을 설치합니다.
$  sudo apt-get update
$ sudo apt-get install apt-transport-https
$ sudo apt-get install ca-certificates 
$ sudo apt-get install curl
$ sudo apt-get install gnupg-agent
$ sudo apt-get install software-properties-common

1-2. GPG 키 추가

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

명령어 실행 후 다음과 같이 응답이 옵니다.

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK


1-3. Docker APT 리포지토리를 시스템에 추가

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

1-4. 도커 엔진 설치

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

최신 버전의 도커를 설치합니다.
특정 버전의 도커를 설치하려면 다음과 같이 'VERSION'을 명시하여 줍니다.

sudo apt install docker-ce=<VERSION> docker-ce-cli=<VERSION> containerd.io

2. 도커 서비스 확인

설치가 완료되면 도커 서비스가 자동으로 시작됩니다.
다음을 입력하여 서비스의 상태를 확인합니다.

sudo systemctl status docker

● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-05-17 02:14:34 UTC; 1min 56s ago

다음과 같이 Activer: active(running) 상태임을 확인할 수 있습니다.

profile
𝑶𝒏𝒆 𝒅𝒂𝒚 𝒐𝒓 𝒅𝒂𝒚 𝒐𝒏𝒆.

0개의 댓글