Serverspace Black Friday
JT
July 1, 2024
Updated July 12, 2024

Installation Docker Engine on CentOS

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
Update packages
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
Process script execution
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
Starting service
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.

Create Server
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:

  • baseurl specifies a link to the repository from which packages will be synchronised and installed;
  • enabled function, which indicates the state of the repository. Whether to include it in the search list or not;
  • gpgcheck checks the EDS of downloaded packages to determine their authenticity and integrity from the moment of transmission;
  • gpgkey the path to the used key in URL path format. To control existing keys on your system, you can also download it, check the hash sum and specify the path to the file via file:///.

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
Result of update
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
Vote:
5 out of 5
Аverage rating : 5
Rated by: 1
33145 North Miami, FL 2520 Coral Way apt 2-135
+1 302 425-97-76
700 300
ITGLOBAL.COM CORP
700 300

You might also like...

We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.