1.1 Prerequisites
CentOS:
- A maintained/supported version of CentOS 7+
- A user account with sudo privileges
- Terminal access
- CentOS Extras repository is enabled by default, but if yours has been disabled you will need to re-enable it
- Software package installer yum
RedHat:
- A maintained/supported version of Redhat 7+ (We tested with RHEL 7.8)
- A user account with sudo privileges
- Terminal access
- Software package installer yum
Ubuntu:
- Ubuntu operating system 16.04+
- A user account with sudo privileges
- Command-line/terminal
- Docker software repositories (optional)
- 1.2 Install Docker on CentOS 7 / RedHat 7.8 With Yum
Step 1: Update Docker Package Database
$ sudo yum check-updateStep 2: Install the Dependencies
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2Step 3: Add the Docker Repository to CentOS / Redhat
To install the edge or test versions of Docker, you need to add the Docker CE stable repository to your system. To do so, run the command:
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoA stable release is tested more thoroughly and has a slower update cycle. On the other hand, Edge release updates are more frequent but are not subject to as many stability tests.
Note: If you are only going to use the stable release, do not enable these extra repositories. The Docker installation process defaults to the latest version of Docker unless you specify otherwise. Leaving the stable repository enabled makes sure that you are not accidentally updating from a stable release to an edge release.
Step 4: Install Docker On CentOS/Redhat Using Yum
With everything set, you can finally move on to installing Docker on CentOS 7 by running:
$ sudo yum install dockerThe system should begin the installation. Once it finishes, it will notify you the installation is complete and which version of Docker is now running on your system.
Your operating system may ask you to accept the GPG key. This is like a digital fingerprint, so you know whether to trust the installation.
Step 5: Manage Docker Service
Although you have installed Docker on CentOS, the service is still not running.
To start the service, enable it to run at startup. Run the following commands in the order listed below.
Start Docker:
$ sudo systemctl start dockerEnable Docker:
$ sudo systemctl enable dockerCheck the status of the service:
$ sudo docker run hello-world- 1.3 Install Docker on Ubuntu With Apt-get
Step 1: Update Software Repositories
$ sudo apt-get updateStep 2: Install Docker
$ sudo apt-get install docker.ioStep 3: Manage Docker Service
Although you have installed Docker on Ubuntu, the service is still not running.
To start the service, enable it to run at startup. Run the following commands in the order listed below.
Start Docker:
$ sudo systemctl start dockerEnable Docker:
$ sudo systemctl enable dockerCheck the status of the service:
$ sudo docker run hello-worldYou will install following packages on all of your machines:
kubeadm
: the command to bootstrap the cluster.kubelet
: the component that runs on all of the machines in your cluster and does things like starting pods and containers.kubectl
: the command line util to talk to your cluster.Here is the referred document from Kubernetes:
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/