1. Install GCC

yum -y install gcc
Copy the code
yum -y install gcc-c++
Copy the code
If the installation is successful, you can see the version GCC -v on the bottom lineCopy the code

\

2, uninstall the previous docker (if not installed before do not need to uninstall)

2-1: root permission Run the following command

yum remove docker \
        docker-client \
        docker-client-latest \
        docker-common \
        docker-latest \
        docker-latest-logrotate \
        docker-logrotate \
        docker-engine
Copy the code

2-2: non-root privileges plus sudo

sudo yum remove docker \
        docker-client \
        docker-client-latest \
        docker-common \
        docker-latest \
        docker-latest-logrotate \
        docker-logrotate \
        docker-engine
Copy the code

\

3. Install the software package

Sudo yum install -y yum-utilsCopy the code

\

4. Set up the mirror vault

This step is very important, we need to change the mirror warehouse to Ali Cloud, so that the download speed is not slow.

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Copy the code

We can view our warehouse configuration file with the following command

cat /etc/yum.repos.d/docker-ce.repo 
Copy the code

\

Update yum package index

yum makecache fast
Copy the code

\

6. Install Docker

yum -y install docker-ce
Copy the code

\

7. Start Docker

systemctl start docker
Copy the code

View the Docker version

docker version
Copy the code

Docker has been installed successfully.

\

8. Configure mirror acceleration

8-1: Obtain the mirror accelerator

Log in to your Baidu cloud account

Copy the acceleration code into daemon.json

{” registry – mirrors “: [xxxxx.mirror.aliyuncs.com]}

mkdir -p /etc/docker
vim /etc/docker/daemon.json
systemctl daemon-reload
systemctl restart docker
Copy the code

Docker document docs.docker.com/engine/inst…