Open Source

docker install on CentOS 8.x

jerymy 2021. 9. 29. 23:04

# install docker-ce, docker-ce-cli, containerd from https://docs.docker.com/engine/install/centos/

# Set up the repository
sudo yum install -y yum-utils

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo


# Install Docker Engine
- Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

# 가이드에는 아래 명령어로 되어있음 -> 실행하면 dependency 오류로 설치 안됨 -> 아래 --allowerasing 옵션 주면 podman 등 package remove 하면서 설치됨.

sudo yum install docker-ce docker-ce-cli containerd.io
sudo yum install docker-ce docker-ce-cli containerd.io --allowerasing


# Start Docker.
sudo systemctl start docker

# Verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world

 

# Uninstall Docker Engine

1. Uninstall the Docker Engine, CLI, and Containerd packages:

sudo yum remove docker-ce docker-ce-cli containerd.io


2. Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd