docker内centos容器安装docker

#安装包
  yum install -y yum-utils
#设置镜像的仓库
  yum-config-manager \
  --add-repo \
  http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#更新yum软件包索引
  yum makecache fast
#安装docker相关 docker-ce 社区版 ee企业版
  yum install docker-ce docker-ce-cli containerd.io
#启动docker
  systemctl start docker
#验证是否启动成功
  docker version
#hello world
  docker run hello-world
#阿里云镜像加速
  sudo tee /etc/docker/daemon.json <<-'EOF'
  {
   "registry-mirrors":["https://qiyb9988.mirror.aliyuncs.com"]
  }
  EOF

 

posted @ 2022-07-30 11:22  AIHHUAO  阅读(146)  评论(0)    收藏  举报