Docker installation (CentOS7 installation)

This article records the process of installing docker on CentOS7

1. First confirm the version#

First confirm that our environment is centOS7

cat /etc/redhat-release

2. yum install gcc related#

The premise is to be able to access the external network. The previous article introduced the relevant network configuration. Refer to the unclear key.

yum -y install gcc gcc-c++

3. Uninstall the old version#

To prevent interference from other versions, we first execute the command to delete the old version

yum -y remove docker docker-common docker-selinux docker-engine

4. Install the required packages#

We also need some necessary software environment, which can be installed as follows

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

5. Set up stable mirror repository#

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

6. Update yum package index#

yum makecache fast

7. Install docker CE

ce is the official free version, which is enough for us to learn and use.

yum -y install docker-ce

8. Start docker

systemctl start docker

9. test#

Check the version of docker

docker version

hello-world case

docker run hello-world

Because we are directly accessing the docker hub and the server is abroad, the access will be very slow, so we need to configure the corresponding image acceleration. We choose Alibaba Cloud's image acceleration here

10. Alibaba Cloud image acceleration#

We can log in to Alibaba Cloud services through Taobao account or Alipay account.
Visit address: http://dev.aliyun.com/search.html

After logging in, select Console

Select Mirror Accelerator and then select CentOS

Create docker folder

mkdir -p /etc/docker

Create the daemon.json file

vim /etc/docker/daemon.json

Then execute the following command

systemctl daemon-reload
systemctl restart docker

Executing the hello-world case

11. Uninstall docker

systemctl stop docker
yum -y remove docker-ce
rm -rf /var/lib/docker

ok~The basic installation of docker is introduced here!

Recommended Posts

Docker installation (CentOS7 installation)
CentOS7 docker installation
Docker CentOS installation method
Centos7 docker installation details
2019-07-09 CentOS7 installation
centos7_1708 installation
CentOS environment installation of Docker
Docker EE installation on centos7
Centos5 installation guide
CentOS 7 install Docker
CentOS7 install Docker
Python - centos6 installation
Centos7 install Docker
Centos7 install docker18
centos7 install docker
CentOS 6 install Docker
Centos8 install Docker
CentOS container installation in Docker uses MySQL
CentOS online installation RabbitMQ3.7
Install Docker on Centos7
Zabbix 2.2.20 installation details (Centos6.9)
CentOS 7 install Docker service
Centos source installation Python3
lamp (centos7) installation lamp environment
Centos7 mqtt cluster installation
CentOS 8.0 installs docker error
Graphical installation of CentOS8
Mysql8.0.15 installation configuration (centos7)
Linux notes (1): CentOS-7 installation
CentOS 8-dnf install docker
Redis3 installation under Centos7
install Docker on centos6.5
CentOS online installation RabbitMQ3.7
Linux CentOS 7 installation tutorial
CentOS 7 install Docker CE
Discourse CentOS 8 new installation manual
Centos mysql installation and configuration
CentOS 8 (2)
Glusterfs cluster installation on Centos7
Redis cluster installation under CentOS
Centos7 installation and configuration prometheus
CentOS 7 Galera Cluster installation guide
CentOS 7 installation and configuration PPTP
CentOS 6.x installation mysql5.7 record
Install docker transfer on Centos7
Graphical centos installation detailed process
Centos7.5 installation and configuration MongoDB4.0.4
Redis cluster installation under CentOS
CentOS 7 installation and configuration PPTP
Hyper-V + CentOS7 installation video tutorial
centos7 kvm installation and use
Install docker on Centos system
Centos7 silent installation of Oracle11g
CentOS 6.8 virtual machine installation details
CentOS 8 (1)
CentOS7 postgresql installation and use
Centos7 installation tomcat process introduction
Centos7.4 environment installation lamp-php7.0 tutorial
Discourse CentOS 8 new installation manual
CentOS8 Linux 8.0.1905 installation process (illustration)
Centos7 elk7.1.1 installation and use