Setting

[Setting | Ubuntu] Docker & Docker Compose 설치

t-opendocs 2025. 4. 22. 15:07
반응형

우분투 환경에 Docker & Docker Compose 설치 방법을 정리한다.


작성일 : 2025-04-22
OS : Ubuntu 24.04.2 LTS

 

<1> Uninstall old version

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

 


 

<2> Set up the repository

# package index update
sudo apt-get update
# install require package
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
# add GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# set up repository
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

 


 

<3> Install Docker

sudo apt-get update

# 설정된 저장소에서 설치가능한 목록확인
sudo apt-cache madison docker-ce
------------------------------------------------------------------------
 docker-ce | 5:28.1.1-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.1.0-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.0.4-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.0.3-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.0.2-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.0.1-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
 docker-ce | 5:28.0.0-1~ubuntu.24.04~noble | https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
--------------------------------------------------------------------------

# 특정 버전으로 설치
sudo apt-get install docker-ce=5:28.1.1-1~ubuntu.24.04~noble docker-ce-cli=5:28.1.1-1~ubuntu.24.04~noble containerd.io docker-compose-plugin

 


 

<4> docker compose 설치

# 설치가능 버전을 확인
sudo apt-cache policy docker-compose
# --------------------------------------------
docker-compose:
  Installed: (none)
  Candidate: 1.29.2-6ubuntu1
  Version table:
     1.29.2-6ubuntu1 500
        500 http://kr.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
# --------------------------------------------

# 특정버전의 docker-compose 설치
sudo apt install docker-compose=1.29.2-6ubuntu1 -y

 


 

<5> 설치 확인

docker --version

 

반응형