Docker installation (Ubuntu)

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

기존 패키지를 제거한다.

1
$ for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

Install using the apt repository

1
2
3
4
5
6
# Add Docker's official GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

apt repository 추가

1
2
3
4
5
6
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

최신 버전 설치

1
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

To verify that Docker is running, use:

1
$ sudo systemctl status docker

Some systems may have this behavior disabled and will require a manual start:

1
$ sudo systemctl start docker

Verify that the installation is successful by running the hello-world image:

1
$ sudo docker run hello-world

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

Author

Gangtai Goh

Posted on

2025-10-01

Updated on

2025-10-08

Licensed under