Docker & Kubernetes

From TheBestLinux.com
Jump to navigation Jump to search

Docker

NOTICE: The following documentation refers to installation of Docker on a Red Hat Enterprise or CentOS Linux Server

Overlay Linux Kernel Driver

To begin with, Docker runs best with the "overlay2" Linux kernel driver enabled/loaded. Run this command as the root/superer or with sudo, as seen here to enable the kernel module at each reboot:

[jamie@cos8vm51.dawgland.com:~]$ echo "overlay" > /etc/modules-load.d/overlay.conf;

Reboot and double check that the Linux kernel overlay module is loaded with this command:

[jamie@cos8vm51.dawgland.com:~]$ lsmod | grep overlay
overlay               135168  0
[jamie@cos8vm51.dawgland.com:~]$ 

If you get the "overlay 135168 0" response after typing the "lsmod | grep overlay" command, you are good to go. If not, you need a newer Linux kernel that supports the overlay2 driver, which is beyond the scope of this article, and you basically need to pick a different Linux distribution.



Required Packages

Docker requires some basic utilities and tools provided by specific Linux packages. For Red Hat Enterprise Linux and CentOS Linux, these packages at minimum are required:

  • dnf-utils
  • device-mapper-persistent-data
  • fuse-overlayfs
  • lvm2
  • wget

To install these packages, or at least double check to make sure they are installed, and if not, then install them, open up a terminal if you are not already at the command prompt of the machine you want to install Docker on. Then, become the root/superuser. I use the "sudo" utility to do this, but you may have other methods depending on your system and preferences.

Here is an example of me doing so on a brand new VM(Virtual Machine) with a minimal installation of CentOS 8, fully updated using the "DNF" utility, which I will also demonstrate the command used to check for updates and refresh the package cache:

[jamie@cos8minvm.dawgland.com:~]$ sudo su -
Last login: Tue Apr  6 19:41:31 PDT 2021 on pts/0
[root@cos8minvm.dawgland.com:~]#


And now that I am the "root", aka the "SuperUser", I will check for updates and refresh the package cache in one command:

[root@cos8minvm.dawgland.com:~]# dnf check-update --refresh
CentOS Linux 8 - AppStream                      7.5 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                          12 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Extras                          51  B/s | 1.5 kB     00:30    
Extra Packages for Enterprise Linux Modular 8 -  27 kB/s |  15 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64   33 kB/s |  14 kB     00:00    
[root@cos8minvm.dawgland.com:~]#

Kubernetes

Kubernetes info coming soon...