Install gcc components first
yum -y install gcc
yum -y install gcc-c++
Uninstall old version
yum -y remove docker docker-common docker-selinux docker-engine
Install the required packages
yum install -y yum-utils device-mapper-persistent-data lvm2
Set up Docker's yum source
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Update yum package index
yum makecache fast
Install docker Ce
yum -y install docker-ce
Start Docker
systemctl start docker
Check if it is activated
ps -ef | grep docker
test
//查看docker版本
docker version
Search for the image on the Alibaba Cloud official website, find the container image service,
find the image accelerator, and
configure the image acceleration according to the instructions in the operating document
Configure mirror acceleration
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://fpcjnjzr.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
Connect docker mirror source
docker run hello-world
Search for mirrors on the official website
Official website link https://hub.docker.com/_/redis
Search redis to
see if there is a mirror
, copy the mirror if there is
Take redis as an example
docker pull redis
Create a container, set up port mapping
docker run -id --name=c_redis -p 6379:6379 redis:6.2.1
Then you can use the physical machine to link redis for testing