To work with the Docker containerisation platform, you need to perform a number of actions to prepare the server for work and install the application itself with the kernel-level virtualisation mechanism. To work with servers, you mainly use components within Docker Engine + Docker CLI as a kernel and client to work with. In this tutorial we will cover their installation!
How do I install Docker on an RPM-like OS?
All steps in the tutorial can be performed on powerful cloud servers. Serverspace provides isolated VPS / VDS servers for common and virtualize usage.
It will take some time to deploy server capacity. After that you can connect in any of the convenient ways!
Let's move on to configuring the server itself, firstly install the necessary dependencies and update the packages on the OS:
dnf update -y
To install Docker, go to the repositories directory and add a new one with the command:
nano /etc/yum.repos.d/docker-ce.repo
After which we will write the appropriate syntax:
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/rhel/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/rhel/gpg
Explicitly specified the name, a link to the repository with the stored data. The Enabled item indicates that the repository should be included in the list of utility searches, enabled gpg checking, and also provided a URL link to the key itself for checking incoming packages. Let's try to install the utilities to check if they work:
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
After that it is necessary to specify the installation by entering the Y value and wait for the end of the installation, for starting we need to execute a command:
systemctl start docker
But what if a wrong version has been installed or you just need to uninstall the container manager?
To install a specific version of Docker packages, specify the required version in the line after each package, for example dnf install docker-ce VERSION_STRING.
How do I uninstall Docker from Linux?
You can also use a package manager and a special mask to uninstall:
dnf remove docker* podman containerd.io
And also it is necessary to remove the remaining packages on the machine:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
After that the files from the operating system will be deleted, to reinstall the necessary packages use the dnf reinstall command.