Docker安装
1. 卸载旧版docker
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2. 配置Docker的yum库
安装yum工具
yum install -y yum-utils
配置Docker的yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3. 安装Docker
yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4. 启动和校验
# 启动Docker
systemctl start docker
# 停止Docker
systemctl stop docker
# 重启
systemctl restart docker
# 设置开机自启
systemctl enable docker
# 执行docker ps命令,如果不报错,说明安装启动成功
docker ps
5. 配置镜像加速
5.1 注册阿里云账号
5.2 开通镜像服务
5.3 配置镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://加速器地址"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
标签:ce,systemctl,yum,Docker,安装,docker
From: https://www.cnblogs.com/zjh0420/p/17797294.html