3. Docker installation and uninstallation

1. Conditions for installing Docker under CentOS


 1. Premise

Docker currently supports the following CentOS versions:

  • Currently, CentOS only supports Docker in the kernel in the release version
  • Docker runs on CentOS 7, and requires a 64-bit system and a system kernel version of 3.10 or above
  • Docker runs on CentOS-6.5 or higher version CentOS, requires the system to be 64-bit, and the system kernel version is 2.6.32-431 or higher

2. Check the version, etc.

①. Check the CentOS version

②. Check the Linux system kernel version

Note: Centos 7.2 kernel 3.10, which meets the conditions for installing Docker.

 

2. Install Docker


There are several ways to install Docker, either using yum or using a script.

1. Install Docker using yum

First, install it with the following install command:

yum -y install docker-io

This completes the installation.

Second, start the Docker background service and view the Docker process:

Finally, the test runs hello-world:

2. Install docker by script

First, make sure the yum package is updated to the latest

sudo yum update

Second, execute the Docker installation script

curl -fsSL https://get.docker.com/ | sh

Finally, start the Docker background service

sudo service docker start

 

3. Uninstall Docker


1. First search for the installed docker installation package 

2. Delete the installation package separately

[root@VM_16_2_centos ~]#yum –y remove docker.x86_64 
[root@VM_16_2_centos ~]#yum –y remove docker-client.x86_64 
[root@VM_16_2_centos ~]#yum –y remove docker-common.x86_64 

3. Delete the Docker image

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324659233&siteId=291194637