Detailed explanation of configuring Docker's yum source and installing it in CentOS7

Detailed explanation of configuring Docker's yum source and installing it in CentOS7

CentOS7 is used here, and the kernel version is

[root@localhost ~]# uname -r
3.10.0-327.el7.x86_64

In this version, the source of yum is configured as Alibaba's mirror source. For specific configuration methods, see Alibaba mirror source configuration method

To facilitate the installation and upgrade of Docker, configure the Docker yum source according to the official Docker documentation. For details, see CentOS docker yum source configuration method https://docs.docker.com/v1.13/engine/installation/linux/centos/

After configuring the yum source, you can use the yum list command to get the installable docker version

[root@localhost ~]# yum list docker --showduplicates |sort -r
 * updates: mirrors.aliyun.com
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, priorities
 * extras: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
docker.x86_64 2:1.12.6-28.git1398f24.el7.centos extras
docker.x86_64 2:1.12.6-16.el7.centos extras
docker.x86_64 2:1.12.6-11.el7.centos extras
docker.x86_64 2:1.12.5-14.el7.centos extras
docker.x86_64 2:1.10.3-59.el7.centos extras
 * base: mirrors.aliyun.com
Available Packages
[root@localhost ~]# yum list docker-engine.x86_64 --showduplicates |sort -r
 * updates: mirrors.aliyun.com
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, priorities
Installed Packages
 * extras: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
docker-engine.x86_64 1.9.1-1.el7.centos docker-main 
docker-engine.x86_64 1.9.0-1.el7.centos docker-main 
docker-engine.x86_64 1.8.3-1.el7.centos docker-main 
docker-engine.x86_64 1.8.2-1.el7.centos docker-main 
docker-engine.x86_64 1.8.1-1.el7.centos docker-main 
docker-engine.x86_64 1.8.0-1.el7.centos docker-main 
docker-engine.x86_64 1.7.1-1.el7.centos docker-main 
docker-engine.x86_64 17.05.0.ce-1.el7.centos docker-main 
docker-engine.x86_64 17.04.0.ce-1.el7.centos docker-main 
docker-engine.x86_64 17.03.1.ce-1.el7.centos docker-main 
docker-engine.x86_64 17.03.0.ce-1.el7.centos docker-main 
docker-engine.x86_64 1.7.0-1.el7.centos docker-main 
docker-engine.x86_64 1.13.1-1.el7.centos docker-main 
docker-engine.x86_64 1.13.1-1.el7.centos@docker-main
docker-engine.x86_64 1.13.0-1.el7.centos docker-main 
docker-engine.x86_64 1.12.6-1.el7.centos docker-main 
docker-engine.x86_64 1.12.5-1.el7.centos docker-main 
docker-engine.x86_64 1.12.4-1.el7.centos docker-main 
docker-engine.x86_64 1.12.3-1.el7.centos docker-main 
docker-engine.x86_64 1.12.2-1.el7.centos docker-main 
docker-engine.x86_64 1.12.1-1.el7.centos docker-main 
docker-engine.x86_64 1.12.0-1.el7.centos docker-main 
docker-engine.x86_64 1.11.2-1.el7.centos docker-main 
docker-engine.x86_64 1.11.1-1.el7.centos docker-main 
docker-engine.x86_64 1.11.0-1.el7.centos docker-main 
docker-engine.x86_64 1.10.3-1.el7.centos docker-main 
docker-engine.x86_64 1.10.2-1.el7.centos docker-main 
docker-engine.x86_64 1.10.1-1.el7.centos docker-main 
docker-engine.x86_64 1.10.0-1.el7.centos docker-main 
 * base: mirrors.aliyun.com
Available Packages

From the above two paragraphs, we can see that the name of the Docker installation package in the Alibaba Cloud image source is different from the name of the installation package provided by Docker officially. Therefore, when using yum to install, it is very likely that only the first paragraph result will be found. Although the official Docker source is configured, the latest Docker version cannot be searched. It should be noted here that if you want to upgrade Docker using the installation package in the official Docker source, you need to provide the name of the installation package as docker-engine, so that you can find various versions of Docker.

Select version v1.13 for installation here.

If you have installed Docker before (generally using the installation package in the CentOS source), be sure to delete the old version. Because I installed version v1.12 before, version v1.13 has many changes compared to the previous one. If it is not deleted, unexpected problems may arise.

Delete the v1.12 version of docker

In addition to its own docker package, this version of docker has two dependent packages, docker-common and container-linux, which need to be deleted.

[root@localhost ~]# yum erase docker
[root@localhost ~]# yum erase docker-common
[root@localhost ~]# yum erase container-selinux

or

[root@localhost ~]# yum remove docker
[root@localhost ~]# yum remove docker-common
[root@localhost ~]# yum remove container-selinux

Finally install the v1.13 version of docker

[root@localhost ~]# yum -y install docker-engine-1.13.1

Start Docker and set it to start automatically at boot

[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker

You can view the current docker version through the command

[root@localhost ~]# docker version
Client:
 Version: 1.13.1
 API version: 1.26
 Go version: go1.7.5
 Git commit: 092cba3
 Built: Wed Feb 8 06:38:28 2017
 OS/Arch: linux/amd64

Server:
 Version: 1.13.1
 API version: 1.26 (minimum version 1.12)
 Go version: go1.7.5
 Git commit: 092cba3
 Built: Wed Feb 8 06:38:28 2017
 OS/Arch: linux/amd64
 Experimental: false

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed steps to install Docker on CentOS7
  • How to install Docker on CentOS
  • Install Docker on CentOS 7
  • Detailed tutorial on installing Docker on CentOS 8
  • Detailed tutorial on installing Docker on CentOS 8.4
  • The most detailed method to install docker on CentOS 8
  • About the problem of offline installation of Docker package on CentOS 8.4
  • Install Docker on Centos7 (2020 latest version available, just copy and paste)
  • How to install Docker using scripts under Linux Centos
  • Detailed tutorial on installing Docker on CentOS 7.5
  • Install a specific version of Docker for CentOS

<<:  Detailed explanation of MySQL installation and new password authentication method in MySQL 8.0

>>:  Detailed explanation of Angular dynamic components

Recommend

Detailed explanation of MySQL foreign key constraints

Official documentation: https://dev.mysql.com/doc...

Using Docker+jenkins+python3 environment to build a super detailed tutorial

Preface: After the automation is written, it need...

VMware15 installation of Deepin detailed tutorial (picture and text)

Preface When using the Deepin user interface, it ...

A brief discussion on Nginx10m+ high concurrency kernel optimization

What is high concurrency? The default Linux kerne...

Application of Beautiful Style Sheets in XHTML+CSS Web Page Creation

This is an article written a long time ago. Now it...

Summary of commonly used tool functions in Vue projects

Table of contents Preface 1. Custom focus command...

How to use ss command instead of netstat in Linux operation and maintenance

Preface When operating and managing Linux servers...

The difference between KEY, PRIMARY KEY, UNIQUE KEY, and INDEX in MySQL

The problem raised in the title can be broken dow...

The latest popular script Autojs source code sharing

Today I will share with you a source code contain...

How to simulate enumeration with JS

Preface In current JavaScript, there is no concep...

Nginx routing forwarding and reverse proxy location configuration implementation

Three ways to configure Nginx The first method di...

How to use crontab to add scheduled tasks in Linux

Preface The Linux system is controlled by the sys...

Understand CSS3 Grid layout in 10 minutes

Basic Introduction In the previous article, we in...