Docker CE 安装指南–CentOS

官方文档

https://docs.docker.com/install/linux/docker-ce/centos/

1、卸载老的版本

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

2、安装仓库

  • 安装依赖包
sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
  • 安装仓库
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

3、安装Docker

sudo yum install docker-ce docker-ce-cli containerd.io

4、配置国内加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF
sudo systemctl daemon-reload

5、启动Docker

sudo systemctl start docker

6、设置开机启动

sudo systemctl enable docker

未经允许不得转载:君子如兰 » Docker CE 安装指南–CentOS

赞 (0)