Docker & Kubernetes

From TheBestLinux.com
Revision as of 03:03, 7 April 2021 by Jamie (talk | contribs)
Jump to navigation Jump to search

Docker

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:




Kubernetes

Kubernetes info coming soon...