12.07.2024

Installation Docker Engine on CentOS

To work with virtualisation technology, various platforms are used in the OS, which allow to run independent systems, utilities, applications due to isolation of processes and environment at the level of both processor and kernel. Such a solution has become evolutionary and is used actively in the production of various information systems. One of the options for implementing such technology is Docker, the installation of which we will consider in this instruction.

Quick installation of Docker on CentOS!

One of the three options for installing the Docker platform on CentOS, is in a pre-prepared script from the company itself. It will write the repositories and download the key for EDS, then install the necessary software via the package manager.

Note that the user must be root or have sudo privileges. You should also keep in mind that the script does not offer detailed configuration, but only installs/updates the platform packages! And this solution is worth using if the previously listed conditions are met.

Let's update the packages and install the necessary dependencies, for this purpose execute the command:

yum update && dnf install curl nano -y

Screenshot №1 — Update packages

After downloading and granting rights to work with the script, then run it as root:

curl -fsSL https://get.docker.com -o install.sh && chmod 700 install.sh &&\
bash ./install.sh

Screenshot №2 — Process script execution

As a result, the only thing left to do is to start the Docker platform management daemon itself via the provisioning system:

service docker start && service docker status

Screenshot №3 — Starting service

As a result, the containerisation platform is deployed on the machine and ready for use!

Installation via repository

All steps in the tutorial can be performed on powerful cloud servers. Serverspace provides isolated VPS / VDS servers for common and virtualize usage.

Screenshot №4 — Create Server

It will take some time to deploy server capacity. After that you can connect in any of the convenient ways!

For most cases, combat information systems may require a specific version of Docker or manually need to track system performance. For the purpose of more flexible configuration we can use the platform repositories! Let's go to the configuration directory of the package manager and create a file:

cd /etc/yum.repos.d/ && nano docker-ce.repo

Inside of which you need to write a configuration, with a specific syntax:

[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

Each of the above options has its own functionality, the main ones are:

After that we can save the file with Ctrl+O and proceed to install the packages:

yum install docker-ce docker-ce-cli contained.io

Screenshot №4 — Result of update

As you can see in the screenshot above, the docker-ce-stable repository we mentioned was used to install these packages, then all that's left to do is start the daemon and get started!

service docker start