Install docker which automates the deployment of applications inside containers.
About this task
This procedure describes how to install docker on CentOS Stream 8.
Procedure
-
Remove conflict packages with docker first.
dnf -y remove podman runc
-
Download and install the docker package.
curl https://download.docker.com/linux/centos/docker-ce.repo \ -o /etc/yum.repos.d/docker-ce.repo sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/docker-ce.repo dnf --enablerepo=docker-ce-stable -y install docker-ce
-
Enable docker.
systemctl enable --now docker
-
Verify whether docker is installed.
Check the docker version.
docker version
An output example:Client: Docker Engine - Community Version: 24.0.7 API version: 1.43 Go version: go1.20.10 Git commit: afdd53b Built: Thu Oct 26 09:09:18 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 24.0.7 API version: 1.43 (minimum version 1.12) Go version: go1.20.10 Git commit: 311b9ff Built: Thu Oct 26 09:08:20 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.24 GitCommit: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523 runc: Version: 1.1.9 GitCommit: v1.1.9-0-gccaecfc docker-init: Version: 0.19.0 GitCommit: de40ad0