Verifying requirements for Docker installation
Docker is supported on many Linux platforms, such as RHEL, Ubuntu, Fedora, CentOS, Debian, Arch Linux, among others. It is also supported on many cloud platforms, such as Amazon Web Services, Digital Ocean, Microsoft Azure, and Google Cloud. Docker has also released desktop applications for Microsoft Windows and Mac OS X that allows you to easily get Docker up and running directly on your local machine.
In this recipe, we will verify the requirements for Docker installation. We will look at a system with an Ubuntu 18.04 LTS installation, though the same steps should work on other Linux flavors as well.
Getting ready
Log in as a root user on the system that has Ubuntu 18.04 installed.
How to do it…
Perform the following steps:
1. Docker is not supported on 32-bit architecture. To check the architecture on your system, run the following command:
$ uname -i x86_64
- Docker is supported on kernel 3.8 or later. It has been back-ported on some of the kernel 2.6, such as RHEL 6.5 and above. To check the kernel version, run the following command:
$ uname -r 4.15.0-29-generic
- Running the kernel should support an appropriate storage backend. Some of the options for such a backend are VFS, DeviceMapper, AUFS, Btrfs, zfs, and Overlayfs.
For Ubuntu, the default storage backend or driver is overlay2, which has been available since Ubuntu 14.04. Another popular one is DeviceMapper, which uses thedevice-mapper
thin provisioning module to implement layers. It should be installed by default on a majority of Linux platforms. To check for device-mapper
, you can run the following command:
$ grep device-mapper /proc/devices 253 device-mapper
On most distributions, AUFS would require a modified kernel.
- Support for cgroups and namespaces have been in the kernel for sometime, and should be enabled by default. To check for their presence, you can look at the corresponding configuration file of the kernel you are running. For example, on Ubuntu, I can do something like the following:
$ grep -i namespaces /boot/config-4.15.0-29-generic CONFIG_NAMESPACES=y $ grep -i cgroups /boot/config-4.15.0-29-generic CONFIG_CGROUPS=y
Note
The name of the config
file is usually dependent on your kernel version. Your system might have a different filename. If this is the case, change the command accordingly.
How it works…
Docker requires that the host system meets a basic set of requirements in order for it to run correctly. By running the preceding commands, we were able to confirm that our system meets those requirements.
See also
Check out the installation document on the Docker website at https://docs.docker.com/install/.