使用官方安装脚本自动安装

方式一

  1. curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

方式二

  1. curl -sSL https://get.daocloud.io/docker | sh

配置国内镜像源

编辑 docker 的 daemon.json 配置文件

  1. mkdir /etc/docker
  2. vim /etc/docker/daemon.json
  3. # 配置中国科学技术大学(LUG@USTC)的开源镜像
  4. {
  5. "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
  6. }

启动docker

systemctl start docker