Docker installation and mirror accelerator configuration in centos7

It has been installed before and needs to be deleted. If it has not been installed, start the installation:

1. Delete

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

2. Install gcc

yum -y install gcc

yum -y install gcc- c++

After finishing, run gcc -v to check the version, if there is a version, the installation is successful

3. Install the docker package

正式开始安装docker软件包:yum install -y yum-utils device-mapper-persistent-data lvm2

4. Set up stable mirror warehouse The second one is Alibaba Cloud

5. Install docker

更新yum软件包索引: yum makecache fast

安装docker  CE :yum -y install docker-ce  这个是关键,最主要的,比较耗费时间

启动docker: systemctl start docker

测试:docker version 
测试2:  docker run hello-world

6. Configure the mirror accelerator. The steps are as follows: vim /etc/docker/daemon.json This is the docker configuration file

.

1). First register an Alibaba Cloud account of your own, log in to the Alibaba Cloud Developer Platform -> find the container image service -> find the image accelerator -> you can find your accelerator address to connect 

 

2.)

 

7. I am using Alibaba Cloud Image Accelerator: Write the docker configuration file to any one of the following pictures, whether it is NetEase Cloud or Alibaba Cloud, you must have your own account

 

8. Verify that the mirror accelerator configuration is ok, or verify whether it is effective ps -ef|grep docker

9. The last step Uninstall:

 Configuration and installation is complete! ! !

Guess you like

Origin blog.csdn.net/zhangleiyes123/article/details/107633171