cat /etc/redhat-release
yum -y install gcc
yum -y install gcc-c++
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl start docker
docker version
docker run hello-world
配置加速器后下载、拉取等操作都会加快
mkdir -p /etc/docker
- tee /etc/docker/daemon.json <<-'EOF'
- {
- "registry-mirrors": ["第1步复制的加速器地址"]
- }
- EOF
systemctl daemon-reload
systemctl restart docker
docker run hello-world
systemctl stop dockeryum
yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd