Installation of Docker in CentOS Stream – 9

This technical support article helps us to download and install docker and docker-compose in the CentOS Stream -9 Operating System.  We will also provide a script which can be directly executed on the system to automate the whole process.  In this tutorial, we have used yum package manager. However, nowadays, people prefer dnf package manager.

To execute installation commands, we must have root or sudo user privileges.

Installation procedure to install docker

At the very first, we will download the docker repo.

wget https://download.docker.com/linux/centos/docker-ce.repo

Once the repository file is downloaded, copy it to the /etc/yum.repos.d/docker-ce.repo.

cp <download-location><file-name> /etc/yum.repos.d/docker-ce.repo

Install Docker to CentOS Stream 9

If docker-ce is already installed in our system, then we can use the following command to remove it from the system.

yum remove docker
yum remove runc

To install docker in our system, use the following command.

yum install docker-ce

Start and Enable Docker Service in the CentOS Stream 9

systemctl start docker
# Start docker service.

systemctl status docker
# To see the system of docker service.

systemctl enable docker
# This enable the docker service permanently.

Installation procedure to install docker-compose

Visit the following site and find the latest version of docker-compose. In this example, we have used v2.7.0. However, it may be quite possible that the latest version will be different. In that case, replace v2.7.0 with the latest version.

wget  https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-`uname -s`-`uname -m`
# Download appropriate version of 

cp <download_location><file_name> /usr/bin/docker-compose
# copy downloaded docker-compose file to /usr/bin directory.

chmod +x /usr/bin/docker-compose
# Change the permission.

Links to download the whole script, which helps us to perform all the tasks automatically. 
1) Install docker and docker-compose in CentOS Stream 9 


CITE THIS AS:

“Installation of Docker and Docker Compose in CentOS Stream 9”  From NotePub.io – Publish & Share Note! https://notepub.io/technical-support/installation-of-docker-in-centos-stream-9/

 1,369 total views,  1 views today

Scroll to Top
Scroll to Top
%d bloggers like this: