The era of one server - one service ended with the advent of virtualisation, when it became possible to create isolated environments on a device. In general, this technology allows you to isolate resources and processes at the level of both the processor and the OS kernel. Today we are going to talk about the second one, this technology is a set of solutions on the OS, with the help of which the environment is isolated.
What is Docker?
Docker is a platform of services that create separate spaces in the OS through namespace, cgroups and mapping mechanisms, providing independent software spaces or containers. To ensure cross-platform compatibility, a pre-prepared distribution with minimum requirements for application operation is used. And the software itself is packaged in images that can be unpacked quickly and easily with all dependencies.
How to install Docker quickly?
For a flexible and fast installation, you should first check the version of the distribution, preferably use Debian 11-12. Call the utility with the command below and filter the output:
In our case, version 12.2, which fits the installation requirements! If your distribution is outdated, it is advisable to upgrade to Bookworm or Bullseye.
.
Let's update the repository and download the necessary utilities for work:
After the necessary software has been downloaded, let's move on to installing Docker repositories and the platform itself. To verify the integrity and authenticity of packages, gpg-keys are used, which should be downloaded from the official website and placed in the /etc/apt/keyrings directory:
chmod 755 /etc/apt/keyrings &&\
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc &&\
chmod 444 /etc/apt/keyrings/docker.asc
Note that this is the most important point from the point of view of security of packages that will be installed. After all, if the intruder substitutes his own key, further verification will be meaningless. Therefore, make sure that you have an HTTPS connection with a correct certificate that specifies the organisation. Also don't forget to check the hash values of keys on the site and when you receive them on the distribution.
Then we can move on to the configuration of the repository record itself in the files of the package manager, for this we will write the command:
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
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!
And now that the key is downloaded and the repository is prescribed you need to update and install the packages:
And at the end of the installation, you need to run the platform autoloader as desired:
sudo systemctl enable containerd.service
systemctl status docker