Docker is a container-based tool. The containers separated from each other and collections of their software, configuration files, and libraries. The containers are faster and lighter than the virtual instance. It is easy to install and easy to use.
This document provided the steps for how to install docker on CentOS 7 /CentOS 8 / Ubuntu 18.04. It also offered a single script that runs on CentOS 7 /CentOS 8 / Ubuntu 18.04. If you want to skips the steps to install docker, then use this unique script. This script installs every dependency, which requires the docker.
Prerequisites:
OS: Linux (CentOS 7/ Centos 8/ Ubuntu 18.04 base OS)
RAM: 4 GB or higher ( For base instance)
HDD: 3 GB (Available space in the base system) or higher
Kerner Version: 3.10 or higher
Check the following link for CentOS 7 and CentOS 8 installation steps.
Note: The following documentation links provided the minimum hardware requirement for CentOS 7 and CentOS 8 installation. Users can increase the RAM, CPU and HDD size according to software installation.
1. CentOS 7 Installation Steps
2. CentOS 8 Installation Steps
Check the following git repository and commands for the install-docker script.
Git Hub Repository:
The command to Download git repo:
git clone https://github.com/smarttechfunda/install-docker.git
Log in as a non-root user with sudo permission.
OR use sudo su command to login as a root user.
Run the following command. (If you are login as root user then no need to use
sudo command.)$ cd install-docker/script
$ chmod +x install-docker
$ sudo ./install-docker
OR
Use the following steps to install and configure the docker manually.
Note:
Log in as a non-root user with sudo permission.
Docker Installation CentOS 7
Step 1:
Add docker repository to CentOS 7$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum install -y device-mapper-persistent-data lvm2 docker-ce docker-ce-cli containerd.io
Docker Installation CentOS 8
Step 1:
Add docker repository to CentOS 8.$ sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Install the latest version of the docker.$ sudo dnf install -y docker-ce --nobest
Docker Installation On Ubuntu 18.04:
Step 1:
Update Ubuntu 18.04.$ sudo apt update
Step 2:
Install the docker-ce.$ sudo apt install docker-ce -y
Note:
The following steps are common for CentOS 7, CentOS 8 and Ubuntu 18.04
Step 2:
Enable and start the docker service.$ sudo systemctl enable docker
$ sudo systemctl start docker
Step 3:
Check the docker version.$ sudo docker --version
Check the docker help.$ sudo docker
Check the command help in docker.$ sudo docker <COMMAND> --help
Example:$ sudo docker start --help
Check the information like Architecture, CPU, OSType, Kernel Version. Run the following command.$ sudo docker info
Step 4:
Test the docker.$ sudo docker run hello-world
Convert the shell script to binary file automation:
Git hub repo:https://github.com/smarttechfunda/shell-to-binary.git
The command to Download git repo:git clone https://github.com/smarttechfunda/shell-to-binary.git
No comments! Be the first commenter?