centos8安装docker和docker-compose

  1. 首先更新一下:yum -y update

  2. centos8默认使用podman代替docker,所以需要containerd.io,那我们就安装一下就好了
    yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm

     

  3. 安装一些其他依赖
    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 makecache
  4. 安装docker-ce
    dnf -y  install docker-ce --nobest

     

  5. 开启Docker服务并设置开机自启
    systemctl start docker && sudo systemctl enable docker
  6. 测试,如输出下图结果则安装成功
    docker version

     

     

    Docker-compose 安装

  7. //推荐方法一
    # 方法一 (Refer to: https://docs.docker.com/compose/install/) sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose # 方法二 (Refer to: https://docs.docker.com/compose/install/#install-using-pip) sudo pip3 install docker-compose # 测试, 如输出下图结果则安装成功 docker-compose --version # 输出:docker-compose version 1.27.4, build xxx
    
    
    
posted @ 2021-12-04 10:31  吾码的博客  阅读(3006)  评论(0编辑  收藏  举报