2021-01-07 Centos8 安装Docker

1. 安装依赖

dnf install https://download.docker.com/linux/centos/8/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el8.x86_64.rpm

dnf install https://download.docker.com/linux/centos/8/x86_64/stable/Packages/docker-ce-20.10.2-3.el8.x86_64.rpm

dnf install https://download.docker.com/linux/centos/8/x86_64/stable/Packages/docker-ce-cli-20.10.2-3.el8.x86_64.rpm

2.启动 docker

systemctl start docker

3.查看 docker 版本信息

docker -v

4.设置开机自动启动

systemctl enable --now docker

5.(可以不用配置,优化加速镜像下载)docker 阿里云加速 参考https://help.aliyun.com/document_detail/60750.html

sudo mkdir -p /etc/docker

sudo tee /etc/docker/daemon.json <<-'EOF'

{

  "registry-mirrors": ["https://这里是阿里云分配前缀.mirror.aliyuncs.com"]

}

EOF

sudo systemctl daemon-reload

sudo systemctl restart docker

你可能感兴趣的:(2021-01-07 Centos8 安装Docker)