centos7安装docker

安装所需软件包

  yum install -y yum-utils device-mapper-persistent-data  lvm2

添加下载仓库

  yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

列出并排序您存储库中可用的版本

  yum list docker-ce --showduplicates | sort -r

安装Docker Engine-Community 和 containerd

  yum install docker-ce-20.10.6 docker-ce-cli-20.10.6 containerd.io(指定版本)

  yum install docker-ce docker-ce-cli containerd.io(最新版本)

启动docker

  systemctl start docker

 

卸载docker

  yum remove docker-ce

删除镜像、容器、配置文件等内容

  rm -rf /var/lib/docker

 

 

 

docker-compose 安装
  curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  docker-compose version
  chmod +x /usr/local/bin/docker-compose
  docker-compose version

posted @ 2021-09-05 23:59  孤城丶闭  阅读(77)  评论(0编辑  收藏  举报