How to install docker using YUM

How to install docker using YUM

As shown in the following figure:

insert image description here

If the version is Centos 7.0 or above, it will be fine.
The command to view the current system kernel version is as follows:

uname -r

The running results are as follows:

å¨è¿ éæå¥å¾çæè¿ °

Step 2: Clean up the installed docker (if you have not installed it, you can skip this step)

The cleanup commands are as follows:

yum remove docker \
         docker-client \         
				 docker-client-latest \
         docker-common \
         docker-latest \
         docker-latest-logrotate \
         docker-logrotate \
         docker-selinux \
         docker-engine-selinux \
         docker-engine

Step 3: Install the Device Mapper tool

The installation command is as follows:

yum install -y yum-utils device-mapper-persistent-data lvm2

Step 4: Configure Docker's yum data source

Configure the yum data source command as follows:

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

The configuration is successful as shown below:

å¨è¿ éæå¥å¾çæè¿ °

Step 5: Update the yum cache

The command is as follows:

yum makecache fast

Step 6: Install docker-ce (community edition)

The installation command is as follows:

 yum -y install docker-ce

Step 7: Start Docker

The startup command is as follows:

systemctl start docker

Startup

systemctl enable docker.service

Restart:

systemctl restart docker

Start the container and add --restart=always

no does not automatically restart the container. (default value)

on-failure The container exits due to an error (the container exit status is not 0) and restarts the container

Unless-stopped restarts the container only when the container has been stopped or Docker is stopped/restarted

Always restart the container when the container has been stopped or Docker is stopped/restarted

If the project has been run, use update to update

docker update --restart=always container name

After startup, you can use the following command to verify

 docker -v

The results are as follows:

å¨è¿ éæå¥å¾çæè¿ °

This is the end of this article about how to install docker using YUM. For more information about installing docker with YUM, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of configuring Docker's yum source and installing it in CentOS7
  • Detailed explanation of CentOS7 online installation of Docker 17.03.2 using Alibaba Cloud Docker Yum source
  • Install docker offline by downloading rpm and related dependencies using yum
  • Detailed code of the example of downloading the docker installation package from yum and installing it on an offline machine
  • How to configure the docker official source and install docker with yum

<<:  Understand the difference between BR and P tags through examples

>>:  CSS3 achieves various border effects

Recommend

Summary of commonly used multi-table modification statements in Mysql and Oracle

I saw this question in the SQL training question ...

CSS screen size adaptive implementation example

To achieve CSS screen size adaptation, we must fi...

Example of using CSS filter to write mouse over effect

Use CSS filter to write mouse over effect <div...

Detailed explanation of the use of shared memory in nginx

In the nginx process model, tasks such as traffic...

Detailed explanation of Linux netfilter/iptables knowledge points

Netfilter Netfilter is a packet processing module...

Example to explain the size of MySQL statistics table

Counting the size of each table in each database ...

MySQL FAQ series: When to use temporary tables

Introduction to temporary tables What is a tempor...

File sharing between Ubuntu and Windows under VMware

This article records the method of sharing files ...

Nginx server adds Systemd custom service process analysis

1. Take nginx as an example Nginx installed using...

Solve the problem of VScode configuration remote debugging Linux program

Let's take a look at the problem of VScode re...

Summary of various methods for Vue to achieve dynamic styles

Table of contents 1. Ternary operator judgment 2....

MYSQL local installation and problem solving

Preface This article is quite detailed and even a...

Solve the problem of yum installation error Protected multilib versions

Today, when installing nginx on the cloud server,...

How to use async and await in JS

Table of contents 1. async 2. await: 3. Comprehen...